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

Document how to share assets between Dart and OEM-side code #11019

Closed
lukef opened this issue Jun 28, 2017 · 20 comments

Comments

@lukef
Copy link
Contributor

commented Jun 28, 2017

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.

@collinjackson

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2017

Posse has identified this as a launch blocker

@sethladd

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2017

Another reason to eliminate FLX? #9900

@collinjackson

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2017

@tvolkert volunteered to take this one

@collinjackson

This comment has been minimized.

Copy link
Contributor

commented 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

This comment has been minimized.

Copy link
Contributor

commented 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

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2017

yes, we should just get rid of the FLX.

@Hixie

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2017

Leaving in current milestone since dropping FLX is on our short-term priority list.

@Hixie

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2017

@szakarias szakarias added the a: assets label Dec 13, 2017

@szakarias szakarias self-assigned this Dec 13, 2017

@xster

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2018

@szakarias, are there new instructions / docs on this? I'm guessing there are some updates since the flx has been removed.

@Hixie Hixie added this to To Do in Milestone 3 Jan 26, 2018

@Hixie Hixie moved this from To Do to In progress in Milestone 3 Jan 26, 2018

@Hixie Hixie moved this from In progress to FLX in Milestone 3 Jan 26, 2018

@szakarias

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2018

No new instructions. We will be redesigning the asset API fairly soon and hopefully this will be solved.

@cbracken

This comment has been minimized.

Copy link
Member

commented Feb 23, 2018

Related #11892.

@szakarias any updates?

@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Mar 6, 2018

@szakarias was this fixed by flutter/engine#4742?

@MichaelSowah

This comment has been minimized.

Copy link

commented Mar 6, 2018

@tvolkert https://github.com/flutter/flutter/issues/11019....am getting confused now about this asset issues all over...

@MichaelSowah

This comment has been minimized.

Copy link

commented 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

This comment has been minimized.

Copy link
Contributor

commented 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,

res/
    drawable/
    drawable-hdpi/
    drawable-mdpi/
    drawable-xhdpi/
    drawable-xxhdpi/
    drawable-xxxhdpi/

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

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2018

With the recent engine changes flutter/engine#4817 and flutter/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.

@Hixie Hixie changed the title Cannot share assets between flutter and native Document how to share assets between Dart and OEM-side code Apr 3, 2018

@szakarias

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2018

Fixed, see the documentation.

@szakarias szakarias closed this Apr 6, 2018

Milestone 3 automation moved this from A sane asset system (sarah) to Done Apr 6, 2018

@MichaelSowah

This comment has been minimized.

Copy link

commented Apr 6, 2018

@szakarias are these fixes and changes in the dev channel yet or I need to be on master channel?

@szakarias

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2018

Should be on dev 0.2.7.

@MichaelSowah

This comment has been minimized.

Copy link

commented Apr 6, 2018

@szakarias Thanks

@Hixie Hixie removed this from Done in Milestone 3 Apr 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.