Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The model from the example causes an error during build. #1226

Closed
AlexKenbo opened this issue May 26, 2021 · 4 comments
Closed

The model from the example causes an error during build. #1226

AlexKenbo opened this issue May 26, 2021 · 4 comments

Comments

@AlexKenbo
Copy link

The model from the example causes an error during build.

Model from example
https://github.com/simolus3/moor/blob/master/moor/example/example.dart

Errors:

Failed to precompile build_runner:build_runner:
../../tools/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.6.0/lib/src/error/best_practices_verifier.dart:1600:40: Error: Getter not found: 'topLevelVariable'.
      return kinds.contains(TargetKind.topLevelVariable);
                                       ^^^^^^^^^^^^^^^^
../../tools/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.6.0/lib/src/error/best_practices_verifier.dart:2024:23: Error: Getter not found: 'topLevelVariable'.
      case TargetKind.topLevelVariable:
                      ^^^^^^^^^^^^^^^^
../../tools/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.6.0/lib/src/error/best_practices_verifier.dart:2024:23: Error: Type 'dynamic' of the case expression is not a subtype of type 'TargetKind' of this switch expression.
 - 'TargetKind' is from 'package:meta/meta_meta.dart' ('../../tools/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/meta_meta.dart').
      case TargetKind.topLevelVariable:
                      ^
../../tools/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-1.6.0/lib/src/error/best_practices_verifier.dart:2001:13: Context: The switch expression is here.
    switch (this) {
            ^
pub finished with exit code 1
The terminal process "/Users/***/development/tools/flutter/bin/flutter 'pub', 'run', 'build_runner', 'build'" terminated with exit code: 1.

And package MOOR on pub:
Pass static analysis
0/30

0/30 points: code has no errors, warnings, lints, or formatting issues
Failed to run dartanalyzer

@simolus3
Copy link
Owner

The analyzer version 1.6.0 is broken, can you try adding this to your pubspec temporarily:

dev_dependencies:
  analyzer: ^1.7.0

This isn't moor's fault and will likely affect other packages too, but I'll take a look at what moor can do to fix this. I think the analysis failure on pub should be unrelated (obviously the analyzer shouldn't just crash), I'll take a look at that too.

@AlexKenbo
Copy link
Author

The analyzer version 1.6.0 is broken, can you try adding this to your pubspec temporarily:

dev_dependencies:
  analyzer: ^1.7.0

This isn't moor's fault and will likely affect other packages too, but I'll take a look at what moor can do to fix this. I think the analysis failure on pub should be unrelated (obviously the analyzer shouldn't just crash), I'll take a look at that too.

Now he doesn't like the SDK

environment:
sdk: ">=2.12.0 <3.0.0"

So, because flutter_moor_example depends on both analyzer ^1.7.0 and flutter_test any from sdk, version solving failed.
pub get failed (1; So, because flutter_moor_example depends on both analyzer ^1.7.0 and flutter_test any from sdk, version solving failed.)
exit code 1

@simolus3
Copy link
Owner

Uh oh, does analyzer: '>=1.1.0 <1.6.0' work?

@AlexKenbo
Copy link
Author

It works:
dart-lang/sdk#46142 (comment)

dependency_overrides:
  analyzer: '1.5.0'

Uh oh, does analyzer: '>=1.1.0 <1.6.0' work?

And it works too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants