flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Localization generation doesn't work

Open bernaferrari opened this issue 3 years ago • 6 comments

When using flutter_localizations and generate: true, the IDE's 'pub get' clear the generated files, but doesn't generate them. Using flutter pub get in terminal generates them.

[✓] Flutter (Channel beta, 2.3.0-24.1.pre, on macOS 11.4 20F71 darwin-x64,
    locale en-BR)
    • Flutter version 2.3.0-24.1.pre at /usr/local/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 615957513e (4 weeks ago), 2021-06-25 09:24:44 -0700
    • Engine revision 9d517f475b
    • Dart version 2.14.0 (build 2.14.0-188.5.beta)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.3)
    • IntelliJ at /Users/bernardoferrari/Applications/JetBrains Toolbox/IntelliJ
      IDEA Ultimate.app
    • Flutter plugin version 58.0.3
    • Dart plugin version 211.7727

bernaferrari avatar Jul 20 '21 18:07 bernaferrari

@bernaferrari How are you invoking pub get? When I use the menu Tools > Flutter > Flutter Pub Get I see that it runs flutter pub get in the messages pane.

stevemessick avatar Jul 20 '21 20:07 stevemessick

I use this bar image

bernaferrari avatar Jul 20 '21 20:07 bernaferrari

And that one also says it is running flutter pub get. I don't have an easy answer for that. We'll have to verify that it is doing what it says, and if it is investigate why the Flutter tool does something different.

stevemessick avatar Jul 20 '21 20:07 stevemessick

From the menu it works. Just from pubspec it doesn't.

https://user-images.githubusercontent.com/351125/126394962-e8894f59-6a43-4331-b767-8ffd235e9d1c.mov

bernaferrari avatar Jul 20 '21 21:07 bernaferrari

Thanks for the recording!

stevemessick avatar Jul 20 '21 22:07 stevemessick

This appears to be a timing issue. I was unable to reproduce it in a runtime workbench, but was able to using Android Studio Bumblebee and Dolphin. It was not consistent, though.

I think what happens is that the analysis server gets updated before flutter pub get completely finishes. I'm not sure how that could happen, but after a failure the errors go away when the Dart analysis server is restarted.

I'm testing with the "skeleton" sample app.

stevemessick avatar Apr 26 '22 23:04 stevemessick