Repository navigation
Bundling assets only on a specific platform (and remove assets on another platform) #65065
Copy link
Copy link
Closed
Feature
Copy link
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: assetsPackaging, accessing, or using assetsPackaging, accessing, or using assetsa: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.team-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects 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.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool teamwould require significant investmentA PR would not be accepted without a plan for ongoing supportA PR would not be accepted without a plan for ongoing support
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: assetsPackaging, accessing, or using assetsPackaging, accessing, or using assetsa: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.team-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects 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.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool teamwould require significant investmentA PR would not be accepted without a plan for ongoing supportA PR would not be accepted without a plan for ongoing support
Activity
jonahwilliams commentedon Sep 2, 2020
@fzyzcjy why do you think this isn't a duplicate of #8230. These are both feature requests for platform specific assets?
fzyzcjy commentedon Sep 2, 2020
@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 hasarrow.png, while iOS does not contain any files about arrows".jonahwilliams commentedon Sep 2, 2020
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.
fzyzcjy commentedon Sep 2, 2020
@jonahwilliams Thanks!
fzyzcjy commentedon Sep 27, 2020
@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!
pedromassangocode commentedon Sep 28, 2020
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.
fzyzcjy commentedon Sep 28, 2020
@pedromassangocode Thank you very much and sorry for bothering!
17 remaining items
asdiujvaosidujdposiadjapoij commentedon Aug 13, 2025
Does anyone have a workaround for this? Do you just remove assets manually after build (the only idea I have)?
hwkim1127 commentedon Aug 13, 2025
I use makefile with some scripts(bash and bat) when building
amrgetment commentedon Aug 13, 2025
Workaround:
1- bash script
https://chatgpt.com/s/t_689cf3d3d41481919eb05faa653c73bd
2-Use flavors: android_flavor etc

https://docs.flutter.dev/tools/pubspec#assets
feat(assets): add platform-specific asset filtering in pubspec.yaml (#…
feat(assets): add platform-specific asset filtering in pubspec.yaml (f…
github-actions commentedon Nov 26, 2025
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.feat(assets): add platform-specific asset filtering in pubspec.yaml (f…
feat(assets): add platform-specific asset filtering in pubspec.yaml (f…