Skip to content

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

Closed

Description

@lukef

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.

Activity

  1. collinjackson commented on Jul 12, 2017

    @collinjackson
    Contributor

    Posse has identified this as a launch blocker

  2. sethladd commented on Jul 12, 2017

    @sethladd
    Contributor

    Another reason to eliminate FLX? #9900

  3. collinjackson commented on Jul 12, 2017

    @collinjackson
    Contributor

    @tvolkert volunteered to take this one

  4. collinjackson commented on Jul 12, 2017

    @collinjackson
    Contributor

    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.

  5. sethladd commented on Aug 1, 2017

    @sethladd
    Contributor

    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?)

  6. Hixie commented on Aug 1, 2017

    @Hixie
    Contributor

    yes, we should just get rid of the FLX.

  7. Hixie commented on Dec 13, 2017

    @Hixie
    Contributor

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

  8. Hixie commented on Dec 13, 2017

    @Hixie
    Contributor
  9. 3 remaining items

  10. cbracken commented on Feb 23, 2018

    @cbracken
    Member

    Related #11892.

    @szakarias any updates?

  11. tvolkert commented on Mar 6, 2018

    @tvolkert
    Contributor
  12. MichaelSowah commented on Mar 6, 2018

    @MichaelSowah

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

  13. MichaelSowah commented on Mar 6, 2018

    @MichaelSowah

    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...

  14. tvolkert commented on Mar 23, 2018

    @tvolkert
    Contributor

    @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.

  15. szakarias commented on Mar 28, 2018

    @szakarias
    Contributor

    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.

  16. 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
  17. szakarias commented on Apr 6, 2018

    @szakarias
    Contributor

    Fixed, see the documentation.

  18. MichaelSowah commented on Apr 6, 2018

    @MichaelSowah

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

  19. szakarias commented on Apr 6, 2018

    @szakarias
    Contributor

    Should be on dev 0.2.7.

  20. MichaelSowah commented on Apr 6, 2018

    @MichaelSowah

    @szakarias Thanks

  21. github-actions commented on Sep 3, 2021

    @github-actions

    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.

  22. locked as resolved and limited conversation to collaborators on Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions