Skip to content

Bundling assets only on a specific platform (and remove assets on another platform) #65065

Description

@fzyzcjy

NOTE: This is not a duplicate! My previous issue #64993 is closed because of wrongly marked as a duplicate. Thus I have no choice but to create it again :/

(Why not duplicate of #8230 : I want to bundle those 1MB photos only in Android. Thus, in the final .ipa file of iOS, there are no such photos taking space.)

Steps to Reproduce

Hi thanks for the wonderful Flutter! I have some images (1.1MB) that should only be used in Android, not iOS. Therefore, I want to remove those images from the IPA file in iOS. I have read the official doc, but it did not mention things like this :/

Expected results:

Give some options, such as (pubspec.yaml):

flutter:
  assets:
    android:
      - some_images_only_in_android/
    ios:
      - some_images_only_in_ios/
   all:
      - some_images_for_both/

Actual results: No such feature

Logs

Activity

  1. jonahwilliams commented on Sep 2, 2020

    @jonahwilliams
    Contributor

    @fzyzcjy why do you think this isn't a duplicate of #8230. These are both feature requests for platform specific assets?

  2. fzyzcjy commented on Sep 2, 2020

    @fzyzcjy
    ContributorAuthor

    @jonahwilliams Hi thanks for the reply! That one is "...use a platform (android/iOS) as a variant...", meaning that, given arrow.png, android may use one arrow shape and ios another. However, in my feature request, I want "Android has arrow.png, while iOS does not contain any files about arrows".

  3. jonahwilliams commented on Sep 2, 2020

    @jonahwilliams
    Contributor

    That's a good point. I had considered excluding assets as part of that feature request inherently, but it isn't very explicit in the original bug.

  4. fzyzcjy commented on Sep 2, 2020

    @fzyzcjy
    ContributorAuthor
  5. added
    a: imagesLoading, displaying, rendering images
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    on Sep 2, 2020
  6. fzyzcjy commented on Sep 27, 2020

    @fzyzcjy
    ContributorAuthor

    @jonahwilliams @pedromassangocode @TahaTesser @jmagman Hi I see some tag changing, and it seems I am not alone (people such as @ghowen also needs this feature), so I wonder the status of this feature request? Thanks!

  7. pedromassangocode commented on Sep 28, 2020

    @pedromassangocode

    Hi @fzyzcjy
    Using "add reaction" on the initial comment would increase priority while +1 comments are rather pointless and cause lots of people to get notified for no reason.

  8. fzyzcjy commented on Sep 28, 2020

    @fzyzcjy
    ContributorAuthor

    @pedromassangocode Thank you very much and sorry for bothering!

  9. added
    P3Issues that are less important to the Flutter project
    on Sep 28, 2020
  10. 17 remaining items

  11. removed
    👍Issue needs retriaging to evaluate its popularity
    on Apr 23, 2025
  12. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jul 9, 2025
  13. asdiujvaosidujdposiadjapoij commented on Aug 13, 2025

    @asdiujvaosidujdposiadjapoij

    Does anyone have a workaround for this? Do you just remove assets manually after build (the only idea I have)?

  14. hwkim1127 commented on Aug 13, 2025

    @hwkim1127

    Does anyone have a workaround for this? Do you just remove assets manually after build (the only idea I have)?

    I use makefile with some scripts(bash and bat) when building

  15. amrgetment commented on Aug 13, 2025

    @amrgetment
  16. added
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Nov 3, 2025
  17. added a commit that references this issue on Nov 12, 2025
    5239c8d
  18. added a commit that references this issue on Nov 22, 2025
    f83f97d
  19. github-actions commented on Nov 26, 2025

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

  20. locked as resolved and limited conversation to collaborators on Nov 26, 2025
  21. added a commit that references this issue on Dec 2, 2025
    6d6d484
  22. added a commit that references this issue on Dec 10, 2025
    0582b52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: assetsPackaging, accessing, or using assetsa: imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.team-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamwould require significant investmentA PR would not be accepted without a plan for ongoing support

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions