Problem with building.
ianmacd opened this issue · 4 comments
I'm new to Flutter. Any idea why this is happening? I literally installed Flutter 5 minutes ago and added it to my path.
$ flutter pub run build_runner build
Failed to build build_runner:build_runner:
../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.5.0/lib/src/error/best_practices_verifier.dart:266:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific.
- 'TargetKind' is from 'package:meta/meta_meta.dart' ('../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart').
Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
var kindNames = kinds.map((kind) => kind.displayString).toList()
^^^^^^^^^^^^^
../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.5.0/lib/src/error/best_practices_verifier.dart:1978:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart:91:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.5.0/lib/src/error/best_practices_verifier.dart:268:36: Error: The getter 'commaSeparatedWithOr' isn't defined for the class 'List<dynamic>'.
- 'List' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'commaSeparatedWithOr'.
var validKinds = kindNames.commaSeparatedWithOr;
^^^^^^^^^^^^^^^^^^^^
../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.5.0/lib/src/error/best_practices_verifier.dart:1978:14: Error: A non-null value must be returned since the return type 'String' doesn't allow null.
String get displayString {
^
pub finished with exit code 1
I'm gonna look into it. I have never encountered this issue before and it seems to be an issue of the Dart Analyzer
I'm gonna look into it. I have never encountered this issue before and it seems to be an issue of the Dart Analyzer
I figured it out.
If I edit pubspec.lock
and change the required version of analyzer
from 1.5.0
to 1.7.2
, then I can proceed without errors:
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 93ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 630ms
[INFO] Running build...
[INFO] Running build completed, took 15ms
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 44ms
[INFO] Succeeded after 67ms with 0 outputs (0 actions)
I remain totally ignorant about how Flutter is supposed to work, however. If I run flutter create foo
followed by cd foo; flutter run
, I end up with Chrome opening a demo Flutter app.
It's totally unclear to me how I get from here to an .apk
file or integration with Android Studio, so that I can run the code in the emulator.
If you have a moment, would you mind pointing me in the right direction?
I see that I just need to plug in a device to make the app run on it, but for some reason I'm getting the Flutter demo app, not the Service Node app.
Never mind. I got it figured out.
PR coming your way...