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

[MacOS] Unable to load assets with cyrillic characters in path #94201

Open
andrew-tpz opened this issue Nov 25, 2021 · 3 comments
Open

[MacOS] Unable to load assets with cyrillic characters in path #94201

andrew-tpz opened this issue Nov 25, 2021 · 3 comments
Labels
a: assets Packaging, accessing, or using assets a: internationalization Supporting other languages or locales. (aka i18n) engine flutter/engine repository. See also e: labels. found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@andrew-tpz
Copy link

andrew-tpz commented Nov 25, 2021

Unable to load assets with "ё" or "й" characters in path on iOS. The same assets are successfully loaded on Android.
Unit-test passed on Windows, but failed on MacOS, All other cyrillc characters can be used without error.

Steps to Reproduce

  1. Create new flutter project
  2. Create text asset 'assets/data/ё.txt' with 'ok' text in it
  3. include asset in pubspec.yml
  assets:
    - assets/data/
  1. Create unit-test test/asset_test.dart
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();
    test('Check ё', () async {
      expect(await rootBundle.loadString('assets/data/ё.txt'), 'ok');
    });
  });
}
  1. Execute flutter test on MacOS

Expected results:
Test passed

Actual results:
Test failed with error: unable to load asset

MacOS: BigSur
XCode: 12.4
Flutter: 2.5.3 stable

Code sample Sample project to reproduce with app on iOS or with unit-test on MacOS:

assets_ru.zip

Logs
[+11135 ms] [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: Unable to
load asset: assets/data/2. ё.txt
[   +2 ms] #0      PlatformAssetBundle.load
(package:flutter/src/services/asset_bundle.dart:224:7)
[        ] <asynchronous suspension>
[        ] #1      AssetBundle.loadString
(package:flutter/src/services/asset_bundle.dart:68:27)
[        ] <asynchronous suspension>
[        ] #2      MyHomePage.build.<anonymous closure>.<anonymous closure>
(package:assets_ru/main.dart:43:23)
[        ] <asynchronous suspension>
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Nov 26, 2021
@danagbemava-nc
Copy link
Member

Hi @andrew-tpz, thanks for filing the issue.

Please provide the complete output of flutter doctor -v.

Thank you

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 26, 2021
@andrew-tpz
Copy link
Author

[✓] Flutter (Channel stable, 2.5.3, on macOS 11.4 20F71 darwin-x64, locale
    ru-RU)
    • Flutter version 2.5.3 at /Users/Shared/Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (6 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/coder/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✗] Chrome - develop for the web (Cannot find Chrome executable at
    /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] Connected device (1 available)


! Doctor found issues in 2 categories.

P.S. This Mac is used for iOS builds only.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 26, 2021
@danagbemava-nc danagbemava-nc changed the title iOS - unable to load asset with some cyrillic characters in path unable to load asset with some cyrillic characters in path on macOS Nov 26, 2021
@maheshmnj maheshmnj changed the title unable to load asset with some cyrillic characters in path on macOS [MacOS] Unable to load assets with cyrillic characters in path Nov 26, 2021
@maheshmnj
Copy link
Member

maheshmnj commented Nov 26, 2021

Hi @andrew-tpz, Thanks for filing the issue. I am able to reproduce the issue, With the Cyrillic character. The PlatformAssetBundle.load fails to load the asset. But this works on Windows looks like this is specific to macOS platform.

Windows logs
PS C:\flutter_projects\counter> flutter test
00:01 +1: All tests passed!
PS C:\flutter_projects\counter> 
macOS logs
mahesh@Maheshs-MacBook-Air-M1 triage_issues % flutter test
Running "flutter pub get" in triage_issues...                    1,713ms
00:08 +0 -1: Check ё [E]                                                                                                           
  Unable to load asset: assets/data/ё.txt
  package:flutter/src/services/asset_bundle.dart 224:7  PlatformAssetBundle.load
  
00:08 +0 -1: Some tests failed.  
flutter doctor -v (MacOS)
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-arm, locale en-GB)
    • Flutter version 2.5.3 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (6 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (3 available)
    • iPhone 12 mini (mobile) • 1FBDAEA9-D062-4831-AFEC-820D955D6D88 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-5
      (simulator)
    • macOS (desktop)         • macos                                • darwin-arm64   • macOS 12.0.1 21A559 darwin-arm
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome 96.0.4664.55

• No issues found!
[✓] Flutter (Channel master, 2.6.0-12.0.pre.789, on macOS 12.0.1 21A559 darwin-arm, locale en-GB)
    • Flutter version 2.6.0-12.0.pre.789 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6ae721de3d (5 days ago), 2021-11-21 15:22:37 -0500
    • Engine revision ad00d12833
    • Dart version 2.16.0 (build 2.16.0-35.0.dev)
    • DevTools version 2.8.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (3 available)
    • iPhone 12 mini (mobile) • 1FBDAEA9-D062-4831-AFEC-820D955D6D88 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-5
      (simulator)
    • macOS (desktop)         • macos                                • darwin-arm64   • macOS 12.0.1 21A559 darwin-arm
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome 96.0.4664.55

• No issues found!
flutter doctor -v (Windows)
PS C:\flutter_projects\counter> flutter doctor -v
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19042.1348], locale en-US)
    • Flutter version 2.5.3 at C:\flutter_sdk\stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (6 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\mahesh\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java      
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)    
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.4)      
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31727.386
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.61.2)
    • VS Code at C:\Users\mahesh\AppData\Local\Programs\Microsoft VS Code   
    • Flutter extension version 3.28.0

[√] Connected device (4 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)       • windows       • windows-x64    • Microsoft Windows [Version    
      10.0.19042.1348]
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 96.0.4664.45
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 95.0.1020.44

• No issues found!

@maheshmnj maheshmnj added a: assets Packaging, accessing, or using assets found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-mac Building on or for macOS specifically and removed in triage Presently being triaged by the triage team labels Nov 26, 2021
@goderbauer goderbauer added engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list labels Feb 2, 2022
@a-wallen a-wallen added the a: internationalization Supporting other languages or locales. (aka i18n) label Aug 30, 2022
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-engine Owned by Engine team triaged-engine Triaged by Engine team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: assets Packaging, accessing, or using assets a: internationalization Supporting other languages or locales. (aka i18n) engine flutter/engine repository. See also e: labels. found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
None yet
Development

No branches or pull requests

6 participants