-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Assets do not load on Android add-to-app flutter_module: Unable to load asset: "AssetManifest.json" #120870
Comments
@PhillDubois thanks for filing the issue. This issue is reproducible with provided sample code. When replacing with a network image on Flutter module, it can be displayed well.
✅: No Issue ❌: Issue reproduced flutter doctor -v (stable and master)[✓] Flutter (Channel stable, 3.7.3, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
• Flutter version 3.7.3 on channel stable at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9944297138 (17 hours ago), 2023-02-08 15:46:04 -0800
• Engine revision 248290d6d5
• Dart version 2.19.2
• DevTools version 2.20.1
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Users/huynq/Library/Java/JavaVirtualMachines/corretto-1.8.0_302/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment Corretto-8.302.08.1 (build 1.8.0_302-b08)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2022.1)
• 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
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• 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.75.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 13 (API 33)
• macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.77
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
[!] Flutter (Channel master, 3.8.0-13.0.pre.51, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
• Flutter version 3.8.0-13.0.pre.51 on channel master at /Users/huynq/Documents/GitHub/flutter_master
! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision efde350812 (15 minutes ago), 2023-02-15 21:49:06 -0500
• Engine revision a966cf878f
• Dart version 3.0.0 (build 3.0.0-240.0.dev)
• DevTools version 2.21.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.1)
• 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.15+0-b2043.56-8887301)
[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
• IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
• 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.75.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.100
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category. |
I don't know it that can help, but on the android project folder when I do the command: I have the following results:
So the assets are there, I think that flutter is just not being able to read on the correct directory. |
We're having the same issue and it's blocking us for using flutter (modules, plugins and libs) in our company. |
The workaround for the moment is to fetch everything and cache, including the fonts. |
Are there any temporary solutions for the business code?
The error was reported from the user and I was unable to reproduce the problem myself in our project myself. In addition, I found that the error was followed by a line of type error message in the log.I don't know if it's relevant.
|
@korilin as I've mentioned, the workaround I've found is fetching and caching everything, for fonts, you can use |
Image.asset(assetName, |
have you tried with the code here https://github.com/PhillDubois/flutter_add_2_app ? because it still doesn't work for me |
Debugging this at the moment, dumping some thoughts for now Unzipping the resultant apk in both the good ( Potentially looks like this string is wrong in the case of add 2 app (specifically when depending on the module as source). When running the good case, this string is But in the bad case (a2a depending on module source), the string is |
Confirmed that I can force the assets to load properly in the a2a case by just manually replacing the directory string in question with a hardcoded |
Hmm, it looks like the reason your assets aren't loading in the example app is that you are specifying a path here Still need to figure out if that is WAI or if it should be changing both where we place and where we look for assets. |
Given that this path that you are passing in could even be computed at runtime, I'm going to say this is WAI. The problem is just that you are passing |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
flutter pub get
Expected results:
I expect to see the icons and image loaded.
Actual results:
Neither the icons nor the image loads.
Code sample
on the flutter_module folder I added:
on
main.dart
And my
pubspect.yaml
file is likeOn Android I have the following code:
and
Logs
Logs:
flutter analyze
flutter doctor -v
The text was updated successfully, but these errors were encountered: