-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Using dart run
conflicts with flutter pub get
#53696
Comments
Can you provide a small repro example, ideally as a git repo? |
dart run
conflicts with flutter pub get
I think this is because
cc @mit-mit |
I didn't think you could do a |
Yep |
Yeah - this is a real problem. A workaround is to run But we should really find a solution for the flutter_gen package (either avoid it, or create proper support for it in pub) it keeps on creating problems in different places. @christopherfujino I recently mentioned that we should look into this soon. |
As mentioned in here the conflicts stands because flutter has its own generator (l10n wise). Personally I stumbled on this because I've generated files in a custom folder with the following l10n configuration: arb-dir: lib/l10n/arb
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
output-dir: lib/l10n/gen
synthetic-package: false
nullable-getter: false If it can help, there are two workarounds:
flutter clean && flutter packages get && dart run build_runner build -d
|
@jacob314 FYI |
Hi and thx everyone, my problem is resolved in |
I'm on Flutter 3.16.5 and still got this issue |
@natebosch can we reopen this issue? |
Using I'm having this issue as well. The weird workaround (option 2) of adding |
I stopped receiving this error message, unfortunately I don’t remember exactly what led to this, but here is my configuration. Flutter: l10n.yamlarb-dir: lib/src/core/localization/translations
template-arb-file: app_en.arb
output-localization-file: app_localizations.g.dart
preferred-supported-locales:
- en
nullable-getter: false
use-deferred-loading: true Commanddart --disable-analytics && dart run build_runner build --delete-conflicting-outputs --release |
If any more can't catch this error, then i think maybe close this issue. |
I will check with my case as on Flutter |
Tested with Flutter If I remove the known workaround of having Unhandled exception:
Bad state: Unable to generate package graph, no `/Users/rydmike/dev/code/talo/.dart_tool/flutter_gen/pubspec.yaml` found.
#0 _pubspecForPath (package:build_runner_core/src/package_graph/package_graph.dart:268:5)
#1 _parsePackageDependencies (package:build_runner_core/src/package_graph/package_graph.dart:242:21)
#2 PackageGraph.forPath (package:build_runner_core/src/package_graph/package_graph.dart:120:33)
<asynchronous suspension>
#3 main (file:///Users/rydmike/.pub-cache/hosted/pub.dev/build_runner-2.4.8/bin/build_runner.dart:27:30)
<asynchronous suspension> My arb-dir: lib/core/localization/translations
template-arb-file: app_en.arb
output-dir: lib/core/localization/generated
nullable-getter: false
synthetic-package: false
use-deferred-loading: true Putting |
I keep having problems with this, even worse now. I'm doing nothing different than what described above, but sometimes cleaning, pub-getting and generating code completely breaks The only way I "broke away" from this stalemate is by... running the application. But without the help of my IDE (VS Code). Yes, plainly running .. Couldn't this whole experience improve, somehow? |
I am also facing the issue with |
I get the same issue on 3.19.5 - the dev dependencies workaround works for me as well |
Same issue in 3.19.6, ( |
Same issue here using Flutter 3.19.5. However, I fixed it by removing the
After making these changes, it is necessary to rerun the app to generate the |
@hpoul Had the same issue. I agree with your solution. It was important to make |
Every time after running
dart run build_runner build --delete-conflicting-outputs
command you have to runflutter pub get
to remove the error below.The text was updated successfully, but these errors were encountered: