Skip to content
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

Problem with generating builds #7

Closed
Mik77o opened this issue Dec 6, 2022 · 7 comments
Closed

Problem with generating builds #7

Mik77o opened this issue Dec 6, 2022 · 7 comments

Comments

@Mik77o
Copy link

Mik77o commented Dec 6, 2022

Error: Couldn't resolve the package 'flutter_gen' in 'package:flutter_gen/gen_l10n/phrase_localizations.dart' -
When I generate a new build locally, everything works. When I use codemagic I get errors like this.
Could something be missing in the configuration?

From codemagic:

flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs

When I tried to use the command from the documentation it didn't help.

flutter pub get
flutter pub run phrase
flutter packages pub run build_runner build --delete-conflicting-outputs

Locally
Screenshot 2022-12-06 at 13 20 13

main.dart

    ...
    localizationsDelegates: PhraseLocalizations.localizationsDelegates,
    supportedLocales: PhraseLocalizations.supportedLocales,
    ...
@theSoenke
Copy link
Collaborator

Hi @Mik77o, could you try setting synthetic-package to false in in l10n.yaml and check whether this makes any difference?

@Mik77o
Copy link
Author

Mik77o commented Dec 6, 2022

Hi @Mik77o, could you try setting synthetic-package to false in in l10n.yaml and check whether this makes any difference?

Okay, I will try :)

@Mik77o
Copy link
Author

Mik77o commented Dec 6, 2022

@theSoenke I got:
'phrase_localizations.dart' has been successfully created
flutter packages pub run build_runner build --delete-conflicting-outputs
Unhandled exception:

_bad state: Unable to generate package graph, no /Users/builder/clone/.dart_tool/flutter_gen/pubspec.yaml found.
#0 _pubspecForPath (package:build_runner_core/src/package_graph/package_graph.dart:232:5)
#1 parsePackageDependencies (package:build_runner_core/src/package_graph/package_graph.dart:206:21)
#2 PackageGraph.forPath (package:build_runner_core/src/package_graph/package_graph.dart:101:33)

#3 main (file:///Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner-2.3.2/bin/build_runner.dart:27:30)

pub finished with exit code 255
make: *** [generate-code] Error 255

@Mik77o
Copy link
Author

Mik77o commented Dec 6, 2022

@theSoenke I found something like that: dart-lang/build#2835 (comment)

@Mik77o
Copy link
Author

Mik77o commented Dec 7, 2022

@theSoenke For some reason, running flutter packages pub get instead of flutter pub get for codemagic build script solved my issue (solution from the community). Now build is generated and OTA is working...

@theSoenke
Copy link
Collaborator

@Mik77o Glad this is working now! And thanks for posting the solution in case anyone else runs into the same issue

@Mik77o
Copy link
Author

Mik77o commented Dec 8, 2022

@Mik77o Glad this is working now! And thanks for posting the solution in case anyone else runs into the same issue

Yes, it's very interesting how these two commands differ because according to the documentation they mean the same thing.

sensuikan1973 added a commit to sensuikan1973/pedax that referenced this issue May 15, 2024
sensuikan1973 added a commit to sensuikan1973/pedax that referenced this issue May 15, 2024
* `flutter pub upgrade && flutter pub upgrade --major-versions`

* debug

* Revert "debug"

This reverts commit 7b0f8f9.

* debug phrase/flutter_sdk_example#7 (comment)

* try to use l10n synthetic-package option

* gix

* upd

* fix

* upd

* add comment

* debug

* debug

* d

* d

* d

* d

* d

* d

* d

* d

* d

---------

Co-authored-by: sensuikan1973 <sensuikan1973@users.noreply.github.com>
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

2 participants