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 build fails because of the analyzer package #654

Closed
InAnadea opened this issue Jun 14, 2023 · 2 comments
Closed

The build fails because of the analyzer package #654

InAnadea opened this issue Jun 14, 2023 · 2 comments
Labels
closed-duplicate Closed in favor of an existing report

Comments

@InAnadea
Copy link

I try to run code generation, but I get an error

 *  Executing task: /Users/ivan/fvm/versions/3.10.4/bin/flutter pub run build_runner watch 

Deprecated. Use `dart run` instead.
Building package executable... (3.7s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 193ms
[WARNING] ../../.pub-cache/hosted/pub.dev/mockito-5.4.2/lib/src/builder.dart:1475:45: Error: 'InvalidType' isn't a type.
      if (type.isBottom || type is analyzer.InvalidType) {
                                            ^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/mockito-5.4.2/lib/src/builder.dart:2096:26: Error: 'InvalidType' isn't a type.
    if (type is analyzer.InvalidType) {
                         ^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/mockito-5.4.2/lib/src/builder.dart:2298:33: Error: 'InvalidType' isn't a type.
    } else if (self is analyzer.InvalidType) {
                                ^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/mockito-5.4.2/lib/src/builder.dart:2395:31: Error: The getter 'importPrefix' isn't defined for the class 'NamedType'.
 - 'NamedType' is from 'package:analyzer/dart/ast/ast.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-5.11.1/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'importPrefix'.
    final importPrefix = this.importPrefix;
                              ^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/mockito-5.4.2/lib/src/builder.dart:2397:45: Error: The getter 'name2' isn't defined for the class 'NamedType'.
 - 'NamedType' is from 'package:analyzer/dart/ast/ast.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-5.11.1/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'name2'.
      return '${importPrefix.name.lexeme}.${name2.lexeme}';
                                            ^^^^^
../../.pub-cache/hosted/pub.dev/mockito-5.4.2/lib/src/builder.dart:2399:12: Error: The getter 'name2' isn't defined for the class 'NamedType'.
 - 'NamedType' is from 'package:analyzer/dart/ast/ast.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-5.11.1/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'name2'.
    return name2.lexeme;
           ^^^^^
[INFO] Precompiling build script... completed, took 4.3s
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.


 *  The terminal process "/Users/ivan/fvm/versions/3.10.4/bin/flutter 'pub', 'run', 'build_runner', 'watch'" terminated with exit code: 78. 
 *  Terminal will be reused by tasks, press any key to close it. 

version: 5.4.2

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.10.4, on macOS 13.2.1 22D68 darwin-arm64, locale en-GB)
    ! Warning: `flutter` on your path resolves to /Users/ivan/fvm/versions/3.10.2/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/ivan/fvm/versions/3.10.4. Consider adding /Users/ivan/fvm/versions/3.10.4/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.18.6/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/ivan/fvm/versions/3.10.4. Consider adding /Users/ivan/fvm/versions/3.10.4/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Community Edition (version 2022.2.3)
[✓] IntelliJ IDEA Community Edition (version 2023.1.1)
[✓] VS Code (version 1.78.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 1 category.
@srawlins
Copy link
Member

srawlins commented Jun 14, 2023

We probably missed a bump to analyzer package. 5.13.0 contains InvalidType.

dart pub upgrade should get you analyzer 5.13.0.

@yanok yanok added the closed-duplicate Closed in favor of an existing report label Jun 30, 2023
@yanok
Copy link
Contributor

yanok commented Jun 30, 2023

duplicate of #656 (well, technically the other way around)

@yanok yanok closed this as completed Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

3 participants