Unable to build in Flutter 3.19
Closed this issue · 1 comments
songyang-dev commented
I am trying to build your repo into an Android emulator and I got this error.
../../../AppData/Local/Pub/Cache/hosted/pub.dev/file-6.1.0/lib/src/interface/file.dart:15:16: Error: The method 'File.create' has fewer named arguments than those of overridden method 'File.create'.
Future<File> create({bool recursive = false});
^
org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create').
Future<File> create({bool recursive = false, bool exclusive = false});
^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/file-6.1.0/lib/src/interface/file.dart:15:16: Error: The method 'File.create' doesn't have the named parameter 'exclusive' of overridden method 'File.create'.
Future<File> create({bool recursive = false});
^
org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create').
Future<File> create({bool recursive = false, bool exclusive = false});
^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/file-6.1.0/lib/src/forwarding/forwarding_file.dart:22:8: Error: The method 'ForwardingFile.createSync' has fewer named arguments than those of overridden method 'File.createSync'.
void createSync({bool recursive = false}) =>
^
org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync').
void createSync({bool recursive = false, bool exclusive = false});
^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/file-6.1.0/lib/src/forwarding/forwarding_file.dart:22:8: Error: The method 'ForwardingFile.createSync' doesn't have the named parameter 'exclusive' of overridden method 'File.createSync'.
void createSync({bool recursive = false}) =>
^
org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync').
void createSync({bool recursive = false, bool exclusive = false});
^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/platform-3.0.0/lib/src/interface/local_platform.dart:46:19: Error: Member not found: 'packageRoot'.
io.Platform.packageRoot; // ignore: deprecated_member_use
^^^^^^^^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
suragch commented
I got the same error too. This solved it for me:
flutter pub upgrade
I also took the opportunity to update the tutorial and project code, though I still think the main issue was what I linked to above. Thank you for letting me know about this.