Closed philipmjohnson closed 1 year ago
A few things to try:
build_runner
on Flutter 3.10 should use dart run build_runner...
, not flutter pub run build_runner...
. If you are manually running build_runner, then please try it with dart run
.
Can you run flutter pub upgrade
? Your project is using analyzer 5.10.0
. The new monarch package expects analyzer 5.12.0
. I think I missed that constraint in the monarch pubspec. I'll do some testing and then release a new version of the monarch package. In the meantime, I think flutter pub upgrade
should fix your issue.
Also, Flutter 3.10 uses Dart 3.0.0, and your pubspec says sdk: '>=2.18.4 <3.0.0'
. You might want to change that to sdk: '>=2.18.4 <4.0.0'
.
@fertrig Thanks so much! Your suggestions resolved the problem. For anyone else who stumbles across this, flutter pub upgrade
, and least for my configuration, did not get analyzer to 5.12.0. When I added it explicitly to dev_dependencies, then upgrade failed due to incompatible version constraints. The solution was to stop "pinning" the versions in dev_dependencies and just specify a lower bound. Once I did that, everything worked great. Here's my fixed pubspec.yml for reference purposes:
name: ggc_app
description: Geo Garden Club app
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: '>=2.18.4 <4.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# Theme stuff
flutter_native_splash: ^2.2.14
flex_color_scheme: ^7.0.3
badges: ^3.0.3
flutter_markdown: ^0.6.13
# Form processing
flutter_form_builder: '>=7.7.0'
form_builder_validators: '>=8.4.0'
intl: '>=0.17.0'
# Riverpod
flutter_riverpod: ^2.3.5
riverpod_annotation: ^2.1.1
# Firebase
firebase_core: ^2.4.1
firebase_auth: ^4.2.10
cloud_firestore: ^4.3.1
firebase_ui_auth: ^1.1.7
# Freezed
freezed_annotation: ^2.2.0
json_annotation: ^4.8.0
#Misc
cached_network_image: ^3.2.3
go_router: ^6.5.5
google_fonts: ^4.0.3
logger: ^1.1.0
monarch_annotations: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: '>=2.0.0'
build_runner: '>=2.1.11'
riverpod_generator: '>=2.2.1'
riverpod_lint: '>=1.3.1'
custom_lint: '>=0.3.4'
freezed: '>=2.3.2'
json_serializable: '>=6.6.1'
monarch: '>=3.5.1'
flutter_gen: '>=5.3.0'
analyzer: '>=5.12.0'
flutter_native_splash:
image: assets/images/ggc.png
color: "#43b02a"
flutter:
uses-material-design: true
# Enable generation of localized Strings from arb files.
generate: true
assets:
- assets/images/
- assets/initialData/
- assets/monarchData/
I upgraded Monarch to 3.5.1 from 3.0.0, and now build_runner fails:
Reverting back to Monarch 3.0.0 in pubspec.yaml and running flutter pub get results in build_runner being successful again.
Here's my current environment:
Monarch version:
Pubspec.yaml:
Please let me know if there is any other information I should provide