You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how to share assets between Dart and OEM-side code #11019
If you're creating an app that has native and flutter components there is no way to share images or fonts between flutter and android/ios. This means that assets needed on both sides will have to be included in the binary twice and that could be expensive.
Priority has been adjusted, I removed customer blocker tag. Hopefully the extra breathing room will let us do this in the "right way" even if it takes longer.
@szakarias with the asset re-work, we should be moving towards the goal of storing our assets in the locations that the underlying platform would otherwise store them. e.g. for Android,
There a suites of tools for packing, optimizing, and so forth an app's final bundle that gets distributed through app stores, and they all assume a certain layout of assets. Our current layout, harking from the days of FLX, doesn't play nicely with these tools. But now that we've gotten ourselves away from FLX, we should have more flexibility here.
e.g. for Android, they're moving towards a model where you don't upload an APK to the Play Store, but rather upload all the constituent parts of your APK, and when a user installs an app, the store cleverly constructs the thinnest APK it can ship to the user, containing only the assets that make sense for that user's device-pixel-ratio, locale, etc.
Just making sure that that end goal lines up with what this issue is tracking.
Reacted by xster, Luke, Fabio de Matos and Neil Jay Warner
With the recent engine changes flutter-team-archive/engine#4817 and flutter-team-archive/engine#4785, it is now possible to share assets with native by accessing the Flutter assets through the main bundle on iOS and the AssetManager on Android. Once I document that on our website I will close this issue which is about avoiding asset duplication across platforms.
As a next step it would be great to align even more with the underlying platform, I created #16015 to track this.
changed the title [-]Cannot share assets between flutter and native[/-][+]Document how to share assets between Dart and OEM-side code[/+]on Apr 3, 2018
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 flutter doctor -v and a minimal reproduction of the issue.
Activity
collinjackson commentedon Jul 12, 2017
Posse has identified this as a launch blocker
sethladd commentedon Jul 12, 2017
Another reason to eliminate FLX? #9900
collinjackson commentedon Jul 12, 2017
@tvolkert volunteered to take this one
collinjackson commentedon Jul 12, 2017
Priority has been adjusted, I removed customer blocker tag. Hopefully the extra breathing room will let us do this in the "right way" even if it takes longer.
sethladd commentedon Aug 1, 2017
I believe this came up again, in this Stack Overflow question: https://stackoverflow.com/questions/45428388/how-to-display-an-html-asset-file?utm_source=dlvr.it&utm_medium=twitter
(there may be different solutions to the problem, but it might be easier if the .html file bundled with the app wasn't stuck inside the FLX?)
Hixie commentedon Aug 1, 2017
yes, we should just get rid of the FLX.
Hixie commentedon Dec 13, 2017
Leaving in current milestone since dropping FLX is on our short-term priority list.
Hixie commentedon Dec 13, 2017
cc @szakarias
3 remaining items
cbracken commentedon Feb 23, 2018
Related #11892.
@szakarias any updates?
tvolkert commentedon Mar 6, 2018
@szakarias was this fixed by flutter-team-archive/engine#4742?
MichaelSowah commentedon Mar 6, 2018
@tvolkert https://github.com/flutter/flutter/issues/11019....am getting confused now about this asset issues all over...
MichaelSowah commentedon Mar 6, 2018
am also looking forward to being able to upload bulk images at once and dont need to do it one by one like its currently being handled...
tvolkert commentedon Mar 23, 2018
@szakarias with the asset re-work, we should be moving towards the goal of storing our assets in the locations that the underlying platform would otherwise store them. e.g. for Android,
There a suites of tools for packing, optimizing, and so forth an app's final bundle that gets distributed through app stores, and they all assume a certain layout of assets. Our current layout, harking from the days of FLX, doesn't play nicely with these tools. But now that we've gotten ourselves away from FLX, we should have more flexibility here.
e.g. for Android, they're moving towards a model where you don't upload an APK to the Play Store, but rather upload all the constituent parts of your APK, and when a user installs an app, the store cleverly constructs the thinnest APK it can ship to the user, containing only the assets that make sense for that user's device-pixel-ratio, locale, etc.
Just making sure that that end goal lines up with what this issue is tracking.
szakarias commentedon Mar 28, 2018
With the recent engine changes flutter-team-archive/engine#4817 and flutter-team-archive/engine#4785, it is now possible to share assets with native by accessing the Flutter assets through the main bundle on iOS and the AssetManager on Android. Once I document that on our website I will close this issue which is about avoiding asset duplication across platforms.
As a next step it would be great to align even more with the underlying platform, I created #16015 to track this.
[-]Cannot share assets between flutter and native[/-][+]Document how to share assets between Dart and OEM-side code[/+]szakarias commentedon Apr 6, 2018
Fixed, see the documentation.
MichaelSowah commentedon Apr 6, 2018
@szakarias are these fixes and changes in the dev channel yet or I need to be on master channel?
szakarias commentedon Apr 6, 2018
Should be on dev 0.2.7.
MichaelSowah commentedon Apr 6, 2018
@szakarias Thanks
github-actions commentedon Sep 3, 2021
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
flutter doctor -vand a minimal reproduction of the issue.