Skip to content

Error: Method not found: '$checkedCreate' #139

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

Closed
vishalrao8 opened this issue Oct 19, 2021 · 4 comments · Fixed by #140
Closed

Error: Method not found: '$checkedCreate' #139

vishalrao8 opened this issue Oct 19, 2021 · 4 comments · Fixed by #140
Assignees
Labels
bug Something isn't working
Milestone

Comments

@vishalrao8
Copy link

vishalrao8 commented Oct 19, 2021

On running the build runner command I am getting these errors.

Screenshot (138)

My dev dependencies are:

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: ^2.1.4
  flutter_gen_runner: ^4.0.0
  lint: ^1.7.2
  import_sorter: ^4.6.0

Flutter doctor result:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19043.1288], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.61.1)

Commands tried:

flutter clean
flutter pub get
flutter pub global activate flutter_gen
flutter pub run build_runner build --delete-conflicting-outputs

flutter pub global activate flutter_gen

Package flutter_gen is currently active at version 4.0.0.
Resolving dependencies...
The package flutter_gen is already activated at newest available version.
To recompile executables, first run `global deactivate flutter_gen`.
Installed executable fluttergen.
Activated flutter_gen 4.0.0.
@lcdsmao
Copy link
Member

lcdsmao commented Oct 19, 2021

Hi @vishalrao8
Can you show the version of json_annotation in your pubspec.lock file?
The $checkedCreate was introduced by json_annotation (>= 4.1.0) and it should be brought as the transitive dependency by flutter_gen_runner.

json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.0"

@vishalrao8
Copy link
Author

  json_annotation:
    dependency: transitive
    description:
      name: json_annotation
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.0.1"

@vishalrao8
Copy link
Author

vishalrao8 commented Oct 20, 2021

Overriding dependency with the latest version fixed the issue but why transitive dependency didn't have the latest version by default?

  json_annotation:
    dependency: "direct overridden"
    description:
      name: json_annotation
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.3.0"

@lcdsmao
Copy link
Member

lcdsmao commented Oct 21, 2021

Oh, I see:

json_annotation: '>=4.0.0 <5.0.0'

Our dependency specify is bad.
We should fix that.

@vishalrao8
Thanks for your report!

@lcdsmao lcdsmao self-assigned this Oct 21, 2021
@lcdsmao lcdsmao added the bug Something isn't working label Oct 21, 2021
@wasabeef wasabeef added this to the 4.0.1 milestone Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants