very_good_cli icon indicating copy to clipboard operation
very_good_cli copied to clipboard

App has errors in app_localizations.dart after `very_good create`

Open icodeyou opened this issue 1 year ago • 2 comments

Description A clear and concise description of what the bug is.

Steps To Reproduce

  1. Run this command in your terminal : very_good create flutter_app foo

  2. Go to the folder foo/

  3. Run the command : flutter run --flavor development -t lib/main_development.dart

  4. I see the error :

Error (Xcode): lib/l10n/l10n.dart:2:8: Error: Error when reading '../../../../../../../.pub-cache/hosted/pub.dev/flutter_gen-5.5.0+1/lib/gen_l10n/app_localizations.dart': No such file or directory

Expected Behavior The code should compile after very_good create flutter_app foo

Screenshots image

Additional Context FYI, the error only occurs for common names. If I use a unique ID as the name of the app, it will work (ex : very_good create flutter_app xyz_abk_ojp)

I am on macOS M2, Sonoma 14.5 very_good version : 0.22.0 Flutter version : 3.22.2

icodeyou avatar Jun 14 '24 09:06 icodeyou

Thanks @icodeyou for opening this issue. Can you include a sample of your pubspec.yaml? Does it have flutter_gen: any, if so, if you remove it and try again does it work?

alestiago avatar Jun 14 '24 10:06 alestiago

The solution here seems to fix it for me https://github.com/flutter/flutter/issues/147047

SamC-Apadmi avatar Jun 19 '24 13:06 SamC-Apadmi

Hi @icodeyou 👋 Given there isn't any new information on this and there is a proposed fix environment wise from @SamC-Apadmi I'm going to close this out as there isn't a code change that were going to make for this. If your still having issues feel free to reopen this ticket with more details.

tomarra avatar Jul 02 '24 16:07 tomarra

I think a code fix is still needed here no? I'd expect a template to just run without any additional steps needed, as it stands I have to lookup that thread, make the change manually and then run the code which isn't ideal?

SamC-Apadmi avatar Jul 02 '24 16:07 SamC-Apadmi

this works for me: https://github.com/flutter/flutter/issues/147047#issuecomment-2067599679

After commenting it out the below line in pubspec.yaml it worked.

flutter_localizations:
sdk: flutter
intl: any
#flutter_gen: any

ng-cen avatar Mar 03 '25 07:03 ng-cen