Skip to content

App Clip uncompressed size is larger than 10MB #71098

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

Open
2 of 4 tasks
xster opened this issue Nov 23, 2020 · 43 comments
Open
2 of 4 tasks

App Clip uncompressed size is larger than 10MB #71098

xster opened this issue Nov 23, 2020 · 43 comments
Labels
a: size Reducing IPA/APK/JS sizes P2 Important issues not at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team

Comments

@xster
Copy link
Member

xster commented Nov 23, 2020

Submitting a minimal app currently exceeds the 10mb uncompressed size limit with a

ITMS-90865: Thinned app clip size is too large

on 1.24.0-8.0.pre.344.

Compressed, thinned IPA is 4.6mb, but the current uncompressed breakdown is:

Total: 11,289,773 bytes

[ 320]  AppClip.app
├── [ 90K]  AppClip
├── [ 34K]  Assets.car
├── [ 128]  Base.lproj
│   ├── [ 160]  LaunchScreen.storyboardc
│   │   ├── [2.2K]  01J-lp-oVM-view-Ze5-6b-2t3.nib
│   │   ├── [ 258]  Info.plist
│   │   └── [ 896]  UIViewController-01J-lp-oVM.nib
│   └── [ 160]  Main.storyboardc
│       ├── [1.8K]  BYZ-38-t0r-view-8bC-Xf-vdC.nib
│       ├── [ 258]  Info.plist
│       └── [ 923]  UIViewController-BYZ-38-t0r.nib
├── [ 128]  Frameworks
│   ├── [ 192]  App.framework
│   │   ├── [1.7M]  App
│   │   ├── [ 794]  Info.plist
│   │   ├── [  96]  _CodeSignature
│   │   │   └── [2.7K]  CodeResources
│   │   └── [ 160]  flutter_assets
│   │       ├── [   2]  AssetManifest.json
│   │       ├── [   2]  FontManifest.json
│   │       └── [725K]  NOTICES
│   └── [ 192]  Flutter.framework
│       ├── [7.4M]  Flutter
│       ├── [ 956]  Info.plist
│       ├── [  96]  _CodeSignature
│       │   └── [2.0K]  CodeResources
│       └── [781K]  icudtl.dat
├── [4.2K]  Info.plist
├── [   8]  PkgInfo
├── [  96]  _CodeSignature
│   └── [6.7K]  CodeResources
└── [104K]  embedded.mobileprovision

The App.framework/App breakdown is:

Screen Shot 2020-11-23 at 11 15 52 AM

The flutter package breakdown is:
Screen Shot 2020-11-23 at 11 17 10 AM

The Flutter.framework/Flutter breakdown (on an equivalent Android libflutter.so, since we don't have a tool to break down iOS dylibs yet dart-lang/sdk#44278):

Screen Shot 2020-11-23 at 11 23 09 AM

Possible explorations

  • [90k] Dig more into what the AppClip binary is.
  • [1.6m] Build App.framework/App with split-debug-info.
  • [781k] The NOTICES file is huge. Since the uncompressed size is being measured here, there might be de-duplication potential. Deduplicate NOTICES #71102
  • [1m] The 70kb ld-temp.o and the 950kb unattributed code in the Flutter.framework/Flutter / libflutter.so is suspicious.
@xster xster added platform-ios iOS applications specifically a: size Reducing IPA/APK/JS sizes P2 Important issues not at the top of the work list labels Nov 23, 2020
@xster
Copy link
Member Author

xster commented Nov 24, 2020

The measured App.framework/App is already building with split-debug-info, which went from 2,057,088 bytes to 1,774,672.

@xster
Copy link
Member Author

xster commented Dec 15, 2020

#71102 brings it down by a bit

> zipinfo -m AppClip-9C3E397E-C262-473A-AB39-9E3F03DD9B35.ipa
Archive:  AppClip-9C3E397E-C262-473A-AB39-9E3F03DD9B35.ipa
Zip file size: 4651240 bytes, number of entries: 37
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/_CodeSignature/
-rw-r--r--  2.1 unx     6863 bX 72% defN 20-Dec-15 13:14 Payload/AppClip.app/_CodeSignature/CodeResources
-rwxr-xr-x  2.1 unx    92416 bX 90% defN 20-Dec-15 13:14 Payload/AppClip.app/AppClip
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/Main.storyboardc/
-rw-r--r--  2.1 unx      923 bX 35% defN 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/Main.storyboardc/UIViewController-BYZ-38-t0r.nib
-rw-r--r--  2.1 unx     1832 bX 41% defN 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib
-rw-r--r--  2.1 unx      258 bX 42% defN 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/Main.storyboardc/Info.plist
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/LaunchScreen.storyboardc/
-rw-r--r--  2.1 unx     2260 bX 43% defN 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib
-rw-r--r--  2.1 unx      896 bX 34% defN 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib
-rw-r--r--  2.1 unx      258 bX 42% defN 20-Dec-15 13:14 Payload/AppClip.app/Base.lproj/LaunchScreen.storyboardc/Info.plist
-rw-r--r--  2.1 unx    34440 bX 57% defN 20-Dec-15 13:14 Payload/AppClip.app/Assets.car
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/Flutter.framework/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/Flutter.framework/_CodeSignature/
-rw-r--r--  2.1 unx     2084 bX 75% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/Flutter.framework/_CodeSignature/CodeResources
-rw-r--r--  2.1 unx   799760 bX 42% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/Flutter.framework/icudtl.dat
-rwxr-xr-x  2.1 unx  7733808 bX 56% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/Flutter.framework/Flutter
-rw-r--r--  2.1 unx      956 bX 59% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/Flutter.framework/Info.plist
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/_CodeSignature/
-rw-r--r--  2.1 unx     2758 bX 75% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/_CodeSignature/CodeResources
-rwxr-xr-x  2.1 unx  1794752 bX 65% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/App
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/flutter_assets/
-rw-r--r--  2.1 unx    63100 bX  2% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/flutter_assets/NOTICES.Z
-rw-r--r--  2.1 unx        2 bX-99% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/flutter_assets/AssetManifest.json
-rw-r--r--  2.1 unx        2 bX-99% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/flutter_assets/FontManifest.json
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/flutter_assets/packages/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/flutter_assets/packages/cupertino_icons/
drwxr-xr-x  2.1 unx        0 bx  0% stor 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/flutter_assets/packages/cupertino_icons/assets/
-rw-r--r--  2.1 unx      794 bX 57% defN 20-Dec-15 13:14 Payload/AppClip.app/Frameworks/App.framework/Info.plist
-rw-r--r--  2.1 unx   106203 bX 64% defN 20-Dec-15 13:14 Payload/AppClip.app/embedded.mobileprovision
-rw-r--r--  2.1 unx     4280 bX 78% defN 20-Dec-15 13:14 Payload/AppClip.app/Info.plist
-rw-r--r--  2.1 unx        8 bX  0% defN 20-Dec-15 13:14 Payload/AppClip.app/PkgInfo
37 files, 10648653 bytes uncompressed, 4642890 bytes compressed:  56.4%

Looks like the NOTICES part is down by ~700kB.

@acoutts
Copy link

acoutts commented Apr 30, 2021

Does this mean it's under the 10mb limit now to use in production?

@alex-zige
Copy link

@xster thanks for the #71102, looks like it's still just a bit over 10m for production?

@oantajames
Copy link

@xster any updates on when this will be addressed?

@xster
Copy link
Member Author

xster commented May 8, 2021

Correct, it's still over 10mb currently unfortunately. I don't have an ETA for when it'll be addressed.

@marcguillem

This comment was marked as duplicate.

@neiljaywarner
Copy link

@xster bump :). (since it's been 2 months since request for info and 6 months since your last comment hope you don't mind gentle bump

@oantajames

This comment was marked as duplicate.

@kimmy-wang

This comment was marked as duplicate.

@cweagans

This comment was marked as duplicate.

@IanTsang

This comment was marked as duplicate.

@joshzhao

This comment was marked as duplicate.

@oantajames

This comment was marked as duplicate.

@marcguillem

This comment was marked as duplicate.

@eliabieri
Copy link

IOS16 seems to increase the size constraints of App Clips

CleanShot 2022-06-06 at 21 00 30

@joshzhao

This comment was marked as off-topic.

@jmagman
Copy link
Member

jmagman commented Oct 5, 2022

Was anyone able to submit Flutter App Clips to the Store with iOS 16?

@cyberpwnn
Copy link

Would be cool to have a flutter create generated target for app clips in the future if the engine keeps getting smaller and apple keeps moving in the app clip direction.

@workerbee22
Copy link

So the existing documentation on the flutter.dev site is here and may need an update if it turns out we can fit into 15MB?

https://developer.apple.com/documentation/app_clips/choosing_the_right_functionality_for_your_app_clip

@jmagman
Copy link
Member

jmagman commented Dec 19, 2022

So the existing documentation on the flutter.dev site is here and may need an update if it turns out we can fit into 15MB?

Yes, that's correct, the note should be updated. https://docs.flutter.dev/development/platform-integration/ios/ios-app-clip

Was anyone able to submit Flutter App Clips to the Store with iOS 16?

@KitsuneDev
Copy link

I just tried to build an empty AppClip with Flutter and got around 14.9 MB, leaving little room for app code even by iOS 16 standards. I'm trying to analyse size now, but from what I can see, submitting App Clips with Flutter might not be possible yet.

@flutter-triage-bot flutter-triage-bot bot added team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 8, 2023
@acoutts
Copy link

acoutts commented Jul 26, 2023

Do we know where most of the size is coming from? Anything we can exclude to make it smaller?

@jannis6023
Copy link

Do we know where most of the size is coming from? Anything we can exclude to make it smaller?

It seems to me (as a flutter noob) to be the Framework itself being so large

@ghost
Copy link

ghost commented Jul 27, 2023

Do we know where most of the size is coming from? Anything we can exclude to make it smaller?

It seems to me (as a flutter noob) to be the Framework itself being so large

my experiment is that, if you don't use "flutter/material", the size comes down to 12.8M

@Frederik-VP
Copy link

Frederik-VP commented Aug 29, 2023

Do we know where most of the size is coming from? Anything we can exclude to make it smaller?

It seems to me (as a flutter noob) to be the Framework itself being so large

my experiment is that, if you don't use "flutter/material", the size comes down to 12.8M

That’s interesting. Could be fun to try and add basic UI icons (no material) and some basic HTTP request see how much space it requires. Then it seems like it could work 🤔

@espling
Copy link

espling commented Aug 30, 2023

Regarding app clip in a Flutter app, i did also struggle with the size, but what i did in the end was to develop the app clip in swiftui. It's just a separate target in xcode, separated from the Flutter code, so in that way it's possible. Now, my clients app wasn't that advanced so it went quite well with my basic knowledge of swiftui. And maybe this is the only way to ship a Flutter app with an app clip, for now.

@jannis6023
Copy link

jannis6023 commented Aug 30, 2023 via email

@kekko7072
Copy link

kekko7072 commented Sep 5, 2023

Just an idea: What about having the actual Flutter UI on a Web Server and simply implementing a WebView in a swiftUI-App?Am 30.08.2023 um 08:49 schrieb jimad @.>: Regarding app clip in a Flutter app, i did also struggle with the size, but what i did in the end was to develop the app clip in swiftui. It's just a separate target in xcode, separated from the Flutter code, so in that way it's possible. Now, my clients app wasn't that advanced so it went quite well with my basic knowledge of swiftui. And maybe this is the only way to ship a Flutter app with an app clip, for now. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.>

Your Idea is great, i've tested and works. Simply add AppClip target and then add simply SwiftUI code for rendering a web page witch use flutter. I had some trouble with adding flavos (Staging and debugging bundle) but at the end i solved them. If someone need it i can share the SwiftUI code.

@espling
Copy link

espling commented Sep 5, 2023

Just an idea: What about having the actual Flutter UI on a Web Server and simply implementing a WebView in a swiftUI-App?Am 30.08.2023 um 08:49 schrieb jimad @.>: Regarding app clip in a Flutter app, i did also struggle with the size, but what i did in the end was to develop the app clip in swiftui. It's just a separate target in xcode, separated from the Flutter code, so in that way it's possible. Now, my clients app wasn't that advanced so it went quite well with my basic knowledge of swiftui. And maybe this is the only way to ship a Flutter app with an app clip, for now. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: _@**.**_>

Your Idea is great, i've tested and works. Simply add AppClip target and then add simply SwiftUI code for rendering a web page witch use flutter. I had some trouble with adding flavos (Staging and debugging bundle) but at the end i solved them. If someone need it i can share the SwiftUI code.

Even if displaying a web view works, one thing to consider is Apple's human interface guidelines regarding web view.

"Avoid using web views in your App Clip. App Clips use native components and frameworks to offer an app-quality experience. If only web components are available to you, offer a quick link to your website instead of an App Clip."

https://developer.apple.com/design/human-interface-guidelines/app-clips

If your app will be rejected due to this is hard to say, but it's good to keep this in mind.

@asoseil
Copy link

asoseil commented Sep 20, 2023

was someone able to deploy a clip app with flutter?

@Zaveri21
Copy link

Zaveri21 commented Oct 11, 2023

I tried to remove exclude pods from the Podfile. but its excluding those pods from Main application target as well.someone find any solution with flutter app?. Unfortunately we can't create new separate app clip app to reduce size because its binding with application.

Anyone have idea to add dependencies in pubsec.yaml file platform & target wise? if we are not able to remove its pods from pods file.

@romeo4934
Copy link

Now the limit is 50Mb on ios17

@jannis6023
Copy link

jannis6023 commented Dec 4, 2023 via email

@jozefvodicka
Copy link

Targeting iOS 17 increases the limit to 15MB;
It's 50MB if triggered by digital invocations such as url (not by QR or NFC tag) Source: Apple official Video

Please update the flutter webpage describing use of iOS App Clip

@jmagman
Copy link
Member

jmagman commented Feb 13, 2024

Targeting iOS 17 increases the limit to 15MB;

From that WWDC video:

If you'd like to make use of physical invocations, such as those through NFC tags or App Clip codes, you'll have to keep to the 15 MB limitation introduced in iOS 16.

So targeting iOS 16 allows the 15MB limit.

@keylinwu
Copy link

keylinwu commented Feb 13, 2024

Targeting iOS 17 increases the limit to 15MB;

From that WWDC video:

If you'd like to make use of physical invocations, such as those through NFC tags or App Clip codes, you'll have to keep to the 15 MB limitation introduced in iOS 16.

So targeting iOS 16 allows the 15MB limit.

If doing an App Clip with Flutter could possibly be very limited by the size, would it be possible to create a Native AppClip(iOS)/Instant App(Android) within a Flutter Project?

@ggirotto
Copy link

If doing an App Clip with Flutter could possibly be very limited by the size, would it be possible to create a Native AppClip(iOS)/Instant App(Android) within a Flutter Project?

Yes, just implement it natively

@espling
Copy link

espling commented Feb 14, 2024

If doing an App Clip with Flutter could possibly be very limited by the size, would it be possible to create a Native AppClip(iOS)/Instant App(Android) within a Flutter Project?

Yes, as you can see I wrote about that earlier. It's just another target in xcode, and that will use a separat prov profile. All those kind of stuff is well documented on apples dev site.

Note, android instant apps does not support the nfc api (or at least it didn't some time ago), if you intend to use that for app clip invocation.

@jmagman
Copy link
Member

jmagman commented Feb 14, 2024

Please update the flutter webpage describing use of iOS App Clip

flutter/website#10145

@jmagman
Copy link
Member

jmagman commented Feb 14, 2024

Updating the sample flutter/samples#2162

sfshaza2 added a commit to flutter/website that referenced this issue Feb 15, 2024
_Description of what this PR is changing or adding, and why:_
1. Update some Xcode screenshots to the current version of Xcode where
the UI has significantly changed.
2. Mention the iOS 16 15MB app clip size limit.
3. Remove "Framework Search Paths" section, that was never necessary.

_Issues fixed by this PR (if any):_
See
flutter/flutter#71098 (comment)


https://flutter-docs-prod--pr10145-app-clip-jej14gwc.web.app/platform-integration/ios/ios-app-clip

## Presubmit checklist

- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.

---------

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
atsansone pushed a commit to atsansone/website that referenced this issue Feb 15, 2024
_Description of what this PR is changing or adding, and why:_
1. Update some Xcode screenshots to the current version of Xcode where
the UI has significantly changed.
2. Mention the iOS 16 15MB app clip size limit.
3. Remove "Framework Search Paths" section, that was never necessary.

_Issues fixed by this PR (if any):_
See
flutter/flutter#71098 (comment)


https://flutter-docs-prod--pr10145-app-clip-jej14gwc.web.app/platform-integration/ios/ios-app-clip

## Presubmit checklist

- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.

---------

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
jmagman added a commit to flutter/samples that referenced this issue Feb 16, 2024
1. Run `flutter run` on the project to pick up project automigrations.
2. Set min version to iOS 16 to take advantage of the 15MB size limit
(see
flutter/flutter#71098 (comment))
3. Other updates needed to avoid Xcode errors and warnings.

First introduced in #538
See also flutter/website#10145
atsansone pushed a commit to atsansone/website that referenced this issue Apr 5, 2024
_Description of what this PR is changing or adding, and why:_
1. Update some Xcode screenshots to the current version of Xcode where
the UI has significantly changed.
2. Mention the iOS 16 15MB app clip size limit.
3. Remove "Framework Search Paths" section, that was never necessary.

_Issues fixed by this PR (if any):_
See
flutter/flutter#71098 (comment)


https://flutter-docs-prod--pr10145-app-clip-jej14gwc.web.app/platform-integration/ios/ios-app-clip

## Presubmit checklist

- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.

---------

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
@sumanthratna
Copy link

Hey @xster, is there anything we can do to help move this forward?

Our App Clip (uncompressed, thinned) is currently at 14.9 MB (even after switching out MaterialApp for WidgetsApp). Happy to try and help to reduce Flutter engine size and overall iOS build size [with guidance]

P.S. I noticed that App Thinning doesn't seem to help much -- the IPA size for Universal variant is equal to the IPA size for all compatible variants. Is this something you've seen before, and if so, does it imply that we've misconfigured something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: size Reducing IPA/APK/JS sizes P2 Important issues not at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team
Projects
None yet
Development

No branches or pull requests