-
Notifications
You must be signed in to change notification settings - Fork 209
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
[build_runner 1.10.3] Bad state: Unable to generate package graph #2835
Comments
It sounds like build_runner was ran from inside the |
Hi @jakemac53 |
The build package doesn't read from the cc @jonahwilliams do you know what the deal is with that? |
@jakemac53 |
I tried removing |
Ok, the |
Do you mean that |
@aliyazdi75 |
It wouldn't necessarily be wrong to also generate a pubspec.yaml there, especially if it smooths things over with build runner. |
We do require a pubspec. It doesn't have to be a particularly meaningful one, but we do rely on knowning the direct dependencies of each package for a lot of hueristics (for ordering build steps and things). This is a fundamental constraint of the system. Plenty of other tools expect a pubspec to exist for all packages as well, I would just put a minimal one in there. |
@shihaohong is this something you could take a look at? |
I can take a stab at it! |
Any news about the issue? Now that Flutter 1.22 is out, I was following the guide to set up the new internationalization system. The guide says to add a new flutter:
# Adds code generation (synthetic package) support
generate: true Inside Currently, I am unable to run the generator at all. @shihaohong Is there any workaround or should I wait to include the new internationalization? |
I removed the The problem error disappears when I remove |
Same here. (Tried 1.10.1, 1.10.2, 1.10.3)
If I add a empty pubspec.yaml in the flutter_gen directory. The build is working again name: test
description: A new Flutter application.
version: 1.0.0
dependencies:
dev_dependencies: |
Thanks @mark-apn worked for me too |
Same issue for me. Any news? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@KlausJokinen I am going to hide our somewhat off topic conversation just to clean up the thread here - if you have further questions please open an issue and we will be happy to discuss there :) |
This comment has been minimized.
This comment has been minimized.
It's not fix, it's workaround. As soon as tou run |
Hi all, thank you for your patience. flutter/flutter#68206 should have fixed this issue in |
I don't see this as a workaround tbh. You can maybe do this for a local checkout but the i10n feature is practically not useable with current stable version for larger teams and existing CI pipelines. |
Closing the issue here as it seems this is resolved on the flutter side of things - please re-open an issue on the flutter repo as indicated if you are still experiencing issues (or would like to advocate for a hotfix stable release). |
Possibly In any case though I would open a new issue on the flutter repo. All packages must have a pubspec, and they must declare their used dependencies. If they aren't published on pub then the flutter tool should put |
Best way to solve it is manually. create in folder ".dart_tool" in your project environment folder called "flutter_gen" good luck in case of more problems: dependency_overrides: then flutter clean, then flutter pub get |
Deleting I understand |
You don't need l10n, remove
` |
I just run Happy Codes :) |
Simply relying on |
April '23, it happened again to me after a clean. What fixed it was changing the sequence of commands.
When I tried to run build_runner before gen-l10n, I had the error. Swapping them in the sequence fixed it. |
* Refactored localization - Created feature localizations - Created Delegates - Refactored folder structure a bit * Fixed issue caused by dart-lang/build/issues/2835 * Fixed issue by creating typedef
I THINK THIS IS THE ANSWER. |
For me the minimal cleanup needed is
|
Replacing |
I had a similar issue developing on Chrome OS Flex:
I was able to fix it by changing generate from true to false in my pubspec.yaml like so:
Is it some issue with intl package? |
This is being discussed and tracked at dart-lang/sdk#53696 |
I got the same exception but my solution was strange: I generated localization code and files first with:
and then generating others wıth:
worked seamlessly. |
That issue doesn't seem to fix this issue. |
The linked issue has been reopened. Unless we suspect there is a different problem than the conflict between If there is a different issue than the conflict in package resolutions it can be opened as a new issue in this repo. |
I'm not sure why this phenomenon occurs, but I have identified the following reproduction conditions and a solution. Reproduction conditions:If you run pub get even once in a Flutter package that depends on both l10n and build_runner, errors will occur in all subsequent "dart run build_runner build" operations. Solution:Delete the pubspec.lock file right before each "dart run build_runner build". I hope my case will be helpful. |
If you are not using flutter_gen in your project, then simply removing that dependency from pubspec.yaml and deleting .dart_tool directory can solve it for you. |
I can confirm that @ktul15 's approach is still working. |
build_runner: ^1.10.3
flutter packages pub run build_runner build
:flutter doctor -v
:The text was updated successfully, but these errors were encountered: