Skip to content

cannot load assets file starting with "#" from the rootBundle after install #46163

@rockingdice

Description

@rockingdice

This issue is a bit confusing.
I cannot load asset files from the rootBundle whose filename is starting with "#", only happen the first time after install.

Those files which are not starting with "#" can be loaded correctly.
If I try to hot restart, all files can be loaded correctly.
If I stop the app, and rerun I can surely reproduce the issue.

I also tried to rename the file "#abc" to "abc", then it can be loaded correctly, but if I change back to "#abc", it cannot be loaded anymore.

My guessing: is "#" a special letter inside the flutter framework?

part of the .yaml file:

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
  - assets/
  - data/
  - texturesheets/

The exception:

Unable to load asset: data/#i18n_quests.bd
I/flutter (19898): #0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
I/flutter (19898): <asynchronous suspension>
I/flutter (19898): #1      DataManager.loadTDFile (package:mhwo/data_module/data_manager.dart:414:25)
I/flutter (19898): #2      DataManager.reloadData (package:mhwo/data_module/data_manager.dart:853:23)
I/flutter (19898): #3      _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:46:6)
I/flutter (19898): #4      DataManager.reloadData (package:mhwo/data_module/data_manager.dart:833:26)
I/flutter (19898): #5      MyAppState.initDataManager.<anonymous closure> (package:mhwo/main.dart:408:21)
I/flutter (19898): #6      _rootRunUnary (dart:async/zone.dart:1134:38)
I/flutter (19898): #7      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
I/flutter (19898): #8      _FutureListener.handleValue (dart:async/future_impl.dart:140:18)
I/flutter (19898): #9      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
I/flutter (19898): #10     Future._propagateToListeners (dart:async/future_impl.dart:711:32)
I/flutter (19898): #11     Future._completeWithValue (dart:async/future_impl.dart:526:5)
I/flutter (19898): #12     Future._asyncComp

flutter doctor -v

[✓] Flutter (Channel master, v1.12.1-pre.10, on Mac OS X 10.14.5 18F203, locale zh-Hans-CN)
    • Flutter version 1.12.1-pre.10 at /Users/li9s/github/flutter
    • Framework revision 061d6a04ff (2 days ago), 2019-12-04 08:07:37 +0800
    • Engine revision 1a96087747
    • Dart version 2.7.0 (build 2.7.0-dev.2.1 e4344a568f)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/li9s/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B500
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 41.1.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 41.2.3
    • Dart plugin version 192.7761

[✓] Connected device (2 available)
    • LON AL00      • TEV0216C22001731                         • android-arm64 • Android 9 (API 28)
    • “RED”的 iPhone • 7640190311b43b9434a4e19f745eb9ddf866e99e • ios           • iOS 12.4.3

• No issues found!

Metadata

Metadata

Assignees

Labels

a: assetsPackaging, accessing, or using assetsc: regressionIt was better in the past than it is nowcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.platform-androidAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions