Skip to content

plz adapter dart 2.10.1 and flutter 1.22.1 #124

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
tenon-du opened this issue Oct 12, 2020 · 14 comments
Closed

plz adapter dart 2.10.1 and flutter 1.22.1 #124

tenon-du opened this issue Oct 12, 2020 · 14 comments

Comments

@tenon-du
Copy link

my environment

Flutter is already up to date on channel stable
Flutter 1.22.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f30b7f4db9 (3 days ago) • 2020-10-08 10:06:30 -0700
Engine • revision 75bef9f6c8
Tools • Dart 2.10.1

the following error occurred when i use flutter packages pub run build_runner build --delete-conflicting-outputs.

[INFO] Generating build script...
[INFO] Generating build script completed, took 484ms

[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 17.0s

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 1.6s

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Running build...
[WARNING] objectbox_generator:resolver on package:objectbox_generator/objectbox_generator.dart:
Your current analyzer version may not fully support your current SDK version.

Please try upgrading to the latest analyzer by running flutter packages upgrade.

Analyzer language version: 2.9.0
SDK language version: 2.10.0

If you are getting this message and have the latest analyzer please file
an issue at https://github.com/dart-lang/sdk/issues/new with the title
"No published analyzer available for language version 2.10.0".
Please search the issue tracker first and thumbs up and/or subscribe to
existing issues if present to avoid duplicates.

[INFO] Generating SDK summary...
[SEVERE] objectbox_generator:resolver on package:objectbox_generator/objectbox_generator.dart:

Bad state: Unexpected diagnostics:
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:152:17 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:119:41 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:133:32 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:186:51 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:88:62 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:153:38 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:64:4 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:154:25 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:18:17 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:118:48 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:132:37 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:19:11 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:159:38 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:168:32 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:47:14 - This requires the 'non-nullable' language feature to be enabled.
[SEVERE] objectbox_generator:resolver on package:objectbox_generator/objectbox_generator.dart:

Bad state: Unexpected diagnostics:
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:152:17 - This requires the 'non-nullable' language feature to be enabled.
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:119:

@greenrobot-team
Copy link
Member

The error above is

[SEVERE] objectbox_generator:resolver on package:objectbox_generator/objectbox_generator.dart:

Bad state: Unexpected diagnostics:
/Users/dugang/Library/Android/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:152:17 - This requires the 'non-nullable' language feature to be enabled.

How is this related to ObjectBox for Flutter?

@greenrobot
Copy link
Member

@DuJerry Do you get the same output with ObjectBox 0.8.0?

@softkot
Copy link

softkot commented Oct 19, 2020

Also unable to generate objectbox after upgrading to flutter 1.22.1 and got the same error for
flutter packages pub run build_runner build --delete-conflicting-outputs

@greenrobot-team
Copy link
Member

@softkot Did you also try with the recently released ObjectBox Dart 0.8.0?

@softkot
Copy link

softkot commented Oct 19, 2020

@softkot Did you also try with the recently released ObjectBox Dart 0.8.0?

Yes i did it with 0.8.0

@softkot
Copy link

softkot commented Oct 19, 2020

I found it works if use build_runner: 1.10.2

@greenrobot-team
Copy link
Member

@softkot So what build_runner version, that did not work, were you using?

@softkot
Copy link

softkot commented Oct 19, 2020

1.10.1 does not work

@greenrobot-team
Copy link
Member

greenrobot-team commented Oct 20, 2020

1.10.1 does not work

That makes sense. According to their changelog this version pins analyzer to 0.39.14.
https://pub.dev/packages/build_runner/changelog

  • Maybe we should require build_runner 1.10.2 or higher? Edit: maybe not, requires Dart 2.10+.

@tenon-du
Copy link
Author

Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.7 19H2, locale zh-Hans-CN)
• Flutter version 1.22.2 at /Users/dugang/Library/Android/flutter
• Framework revision 84f3d28555 (5 days ago), 2020-10-15 16:26:19 -0700
• Engine revision b8752bbfff
• Dart version 2.10.2
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

dependencies:
  json_annotation: ^3.1.0
  objectbox: ^0.8.0
  objectbox_flutter_libs: ^0.8.0

dev_dependencies:
  build_runner: ^1.10.3
  json_serializable: ^3.5.0
  objectbox_generator: ^0.8.0

flutter packages pub run build_runner build generate success

[INFO] Generating build script...
[INFO] Generating build script completed, took 567ms

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 168ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.5s

[INFO] Running build...
[INFO] 2.2s elapsed, 0/1 actions completed.
[INFO] objectbox_generator:resolver on lib/model/entity/test.dart:entity Test(0:0)
[INFO] objectbox_generator:resolver on lib/model/entity/test.dart: property id(0:0) type:6 flags:1
[INFO] objectbox_generator:generator on lib/$lib$:Package: ess
[INFO] objectbox_generator:generator on lib/$lib$:Found 1 entities in: (lib/model/entity/test.objectbox.info)
[INFO] objectbox_generator:generator on lib/$lib$:Using model: lib/objectbox-model.json
[INFO] objectbox_generator:generator on lib/$lib$:Generating code: lib/objectbox.g.dart
[INFO] Running build completed, took 2.4s

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 90ms

[INFO] Succeeded after 2.5s with 4 outputs (5 actions)

@vaind
Copy link
Contributor

vaind commented Oct 23, 2020

@DuJerry please try running pub upgrade and see if that helps you get the fixed dependencies.

For context, this has been caused by dart-lang/build#2763 and as has been said above, seems only to be resolvable by also requiring a fairly recent minimum dart SDK version (v2.10) enforced by the fixed build_runner v1.10.2

@greenrobot-team
Copy link
Member

@DuJerry Thanks for verifying using build_runner ^1.10.3 works as well!

So TL;DR for anyone coming here: use at least build_runner 1.10.2, even better 1.10.3.

@dvilcode
Copy link

dvilcode commented Nov 2, 2020

1.10.2

It works! Thanks

@vaind
Copy link
Contributor

vaind commented Nov 5, 2020

Not sure if we can do anything on our side without raising min-SDK constraint so I'm closing the issue.

Feel free to follow up if you have any change suggestions.

@vaind vaind closed this as completed Nov 5, 2020
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

6 participants