[GH-ISSUE #1075] [Bug] Couldn't generate localizations #427

Closed
opened 2026-03-23 20:36:29 +00:00 by mirror · 7 comments
Owner

Originally created by @dadyarri on GitHub (Sep 17, 2022).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1075

Originally assigned to: @LucasXu0 on GitHub.

Describe the bug
When running flutter pub get before flutter pub run easy_localization:generate -S assets/translations/ i'm getting an error:

Unexpected extension byte (at offset 33)
dart:isolate  _RawReceivePortImpl._handleMessage

Expected behavior
Successful downloading of dependencies

Desktop (please complete the following information):

  • OS: Fedora 36

Additional context

❯ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.2, on Fedora Linux 36 (KDE Plasma) 5.19.8-200.fc36.x86_64, locale ru_RU.UTF-8)
    • Flutter version 3.3.2 on channel stable at /home/dadyarri/projects/community/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e3c29ec00c (3 дня назад), 2022-09-14 08:46:55 -0500
    • Engine revision a4ff2c53d8
    • Dart version 2.18.1
    • DevTools version 2.15.0

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • clang version 14.0.5 (Fedora 14.0.5-1.fc36)
    • cmake version 3.22.2
    • ninja version 1.10.2
    • pkg-config version 1.8.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
    • IntelliJ at /home/dadyarri/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.3739.54
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.71.2)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Fedora Linux 36 (KDE Plasma) 5.19.8-200.fc36.x86_64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.

Originally created by @dadyarri on GitHub (Sep 17, 2022). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1075 Originally assigned to: @LucasXu0 on GitHub. **Describe the bug** When running `flutter pub get` before `flutter pub run easy_localization:generate -S assets/translations/` i'm getting an error: ``` Unexpected extension byte (at offset 33) dart:isolate _RawReceivePortImpl._handleMessage ``` **Expected behavior** Successful downloading of dependencies **Desktop (please complete the following information):** - OS: Fedora 36 **Additional context** ``` ❯ flutter doctor -v [✓] Flutter (Channel stable, 3.3.2, on Fedora Linux 36 (KDE Plasma) 5.19.8-200.fc36.x86_64, locale ru_RU.UTF-8) • Flutter version 3.3.2 on channel stable at /home/dadyarri/projects/community/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision e3c29ec00c (3 дня назад), 2022-09-14 08:46:55 -0500 • Engine revision a4ff2c53d8 • Dart version 2.18.1 • DevTools version 2.15.0 [✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use `flutter config --android-sdk` to update to that location. [✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Linux toolchain - develop for Linux desktop • clang version 14.0.5 (Fedora 14.0.5-1.fc36) • cmake version 3.22.2 • ninja version 1.10.2 • pkg-config version 1.8.0 [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). [✓] IntelliJ IDEA Ultimate Edition (version 2022.2) • IntelliJ at /home/dadyarri/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.3739.54 • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.71.2) • VS Code at /usr/share/code • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (1 available) • Linux (desktop) • linux • linux-x64 • Fedora Linux 36 (KDE Plasma) 5.19.8-200.fc36.x86_64 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 3 categories. ```
Author
Owner

@LucasXu0 commented on GitHub (Sep 20, 2022):

Hi, @dadyarri , would you help to check with the below commands?

cd app_flowy
flutter clean
flutter packages pub get
flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
flutter packages pub run build_runner build --delete-conflicting-outputs
<!-- gh-comment-id:1251761378 --> @LucasXu0 commented on GitHub (Sep 20, 2022): Hi, @dadyarri , would you help to check with the below commands? ``` cd app_flowy flutter clean flutter packages pub get flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json flutter packages pub run build_runner build --delete-conflicting-outputs ```
Author
Owner

@dadyarri commented on GitHub (Sep 20, 2022):

Hi @LucasXu0, got same error again on flutter packages pub get
Here is log file, may be it will help somehow: pub_log.txt

I'm not sure if it's relevant, but a lot of applications on my system (i. e. kde, zsh, brave browser) says there is no space left on disk, although, there is left about 6G on /home

<!-- gh-comment-id:1251839983 --> @dadyarri commented on GitHub (Sep 20, 2022): Hi @LucasXu0, got same error again on `flutter packages pub get` Here is log file, may be it will help somehow: [pub_log.txt](https://github.com/AppFlowy-IO/AppFlowy/files/9604174/pub_log.txt) I'm not sure if it's relevant, but a lot of applications on my system (i. e. kde, zsh, brave browser) says there is no space left on disk, although, there is left about 6G on /home
Author
Owner

@LucasXu0 commented on GitHub (Sep 20, 2022):

Maybe you can release the disk space and try again later.

<!-- gh-comment-id:1252036815 --> @LucasXu0 commented on GitHub (Sep 20, 2022): Maybe you can release the disk space and try again later.
Author
Owner

@dadyarri commented on GitHub (Sep 22, 2022):

Well, i've reinstalled my system and this error disappeared, but there is new on compile application stage. I'll close this and describe new problem in #1125

<!-- gh-comment-id:1254619634 --> @dadyarri commented on GitHub (Sep 22, 2022): Well, i've reinstalled my system and this error disappeared, but there is new on compile application stage. I'll close this and describe new problem in #1125
Author
Owner

@dadyarri commented on GitHub (Sep 22, 2022):

@LucasXu0, forgot about locales 😃. I've tried commands, you've written above, generation locales was sucessfull, but last one gave an error:

❯ flutter packages pub run build_runner build --delete-conflicting-outputs
Unhandled exception:
Bad state: Unable to generate package graph, no `/home/dadyarri/projects/community/appflowy/frontend/app_flowy/.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)
<asynchronous suspension>
#3      main (file:///home/dadyarri/.pub-cache/hosted/pub.dartlang.org/build_runner-2.2.0/bin/build_runner.dart:27:30)
<asynchronous suspension>
pub finished with exit code 255
<!-- gh-comment-id:1254623082 --> @dadyarri commented on GitHub (Sep 22, 2022): @LucasXu0, forgot about locales 😃. I've tried commands, you've written above, generation locales was sucessfull, but last one gave an error: ``` ❯ flutter packages pub run build_runner build --delete-conflicting-outputs Unhandled exception: Bad state: Unable to generate package graph, no `/home/dadyarri/projects/community/appflowy/frontend/app_flowy/.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) <asynchronous suspension> #3 main (file:///home/dadyarri/.pub-cache/hosted/pub.dartlang.org/build_runner-2.2.0/bin/build_runner.dart:27:30) <asynchronous suspension> pub finished with exit code 255 ```
Author
Owner

@rbdog commented on GitHub (Oct 19, 2023):

Hi, @dadyarri Are you still here?

I was able to fix it.
I encountered the same error.
It's not certain, but installing the flutter_gen package might resolve it.

Here is the all commands I executed.


# in any place
# activate the package
$ dart pub global activate flutter_gen

# --- restart VSCode ---

# in /AppFlowy/frontend/appflowy_flutter/ $
$ flutter clean
$ flutter packages pub get
$ flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
$ flutter packages pub run build_runner build --delete-conflicting-outputs

# back to frontend/
$ cd ../

# in /AppFlowy/frontend/ $
# setup manually
$ sh ./scripts/code_generation/language_files/generate_language_files.sh
$ sh ./scripts/code_generation/flowy_icons/generate_flowy_icons.sh
$ sh ./scripts/code_generation/freezed/generate_freezed.sh
<!-- gh-comment-id:1771099298 --> @rbdog commented on GitHub (Oct 19, 2023): Hi, @dadyarri Are you still here? I was able to fix it. I encountered the same error. It's not certain, but installing the `flutter_gen` package might resolve it. Here is the all commands I executed. ``` # in any place # activate the package $ dart pub global activate flutter_gen # --- restart VSCode --- # in /AppFlowy/frontend/appflowy_flutter/ $ $ flutter clean $ flutter packages pub get $ flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json $ flutter packages pub run build_runner build --delete-conflicting-outputs # back to frontend/ $ cd ../ # in /AppFlowy/frontend/ $ # setup manually $ sh ./scripts/code_generation/language_files/generate_language_files.sh $ sh ./scripts/code_generation/flowy_icons/generate_flowy_icons.sh $ sh ./scripts/code_generation/freezed/generate_freezed.sh ```
Author
Owner

@rbdog commented on GitHub (Oct 19, 2023):

and if above was true, I'll open a new issue.
To add descriptions to this page
environment-setup

<!-- gh-comment-id:1771105357 --> @rbdog commented on GitHub (Oct 19, 2023): and if above was true, I'll open a new issue. To add descriptions to this page [environment-setup](https://docs.appflowy.io/docs/documentation/appflowy/from-source/environment-setup)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#427
No description provided.