-
Notifications
You must be signed in to change notification settings - Fork 204
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
APK size has massively grown when upgrading from 0.9.1 to 0.10.x #274
Comments
I have the same issue. |
Same question. |
0.10.0 adds some groundwork for the upcoming text feature. It should add ~450KB. Sounds like we have a configuration bug. We'll take a look. For now use 0.9.1. Can anyone confirm if that's the size of the final stripped store APK? The included binaries will definitely need to be compiled for each target arch so a fat binary will be generated that should be stripped, but 70MB sounds far too big. |
Mine is |
I ran
~3.3MB bigger, which is definitely more but nowhere near the increase you're seeing. Our native library is about 450KB but we also now depend on What build command are you using? |
the difference is for sure coming from Literally running the build back to back and only changing I did it just now again:
0.10.0 ==>
0.9.1 (back down again) ==>
On a related / unrelated note, when building with 0.10.0 I do also get this message, although build otherwise progresses normally:
|
this is interesting! taking a look at the apk built from the example app locally in android studio shows that the additional ~3.3MB we see seem to come from 4 versions of the I would be very curious to be able to take a look at the contents of your apk's to see where the additional size is coming from, that might show us where we need to look here. if you do not mind sharing them, sharing them with [email protected] would be very helpful, (or over discord), but at this point even just a screenshot might be enough to point us in the right direction. also, is it possible to try updating your ndk version? |
Ok I have taken screen shots of the two, hopefully this helps As for the ndk, that is a whole other can of worms. For some reason it does not want to accept that I have the latest ndk at that level already installed. Id rather not hardcode that version in, so I still have to work on that "issue" |
For me, my fat APK size is decreased from 55MB to 17MB when I downgraded from |
Something is clearly wrong, we have not been able to reproduce the bloated application size with our sample application, but there must be something else at play here that we are missing. It also seems that our "raw size" is significantly different to in our sample app for the flutter.so as well, even though the download size is comparable there Do any of you mind sharing access your source code with our team, I think that might help us find the issue faster as we will hopefully be able to reproduce the size bloating issue then. If this is an option, please reach out to us on [email protected] or on discord (I'm Max @ Rive) |
@mjtalbot FYI, I'm on on the latest Flutter version, are you? |
Ofcourse, this is sounds promising... on |
I've just built a the Might there be another difference? I'm running on an intel mac running macOS Ventura 13.2 (a) Beta (22D7750270d) (also just ran master branch which also gets to about 21.9 MB for me) |
I've also just gotten my windows machine building this, it also gets to 21.5MB (its running on the flutter stable channel, 3.3.10) |
I'm on Flutter 3.3.10 • channel stable also I can reproduce the issue on Codemagic CI, let me try to make it public and share it with you. |
@mjtalbot I have messaged you on Discord. |
Mine were also on 3.3.10 stable |
Could one of you that's getting a large apk send me the .aar generated (after running flutter build apk) in the build/rive_common/outputs/aar folder? You can either attach it here (rename to .zip might work) or email [email protected]. |
I grabbed one from the codemagic CI someone shared. These are larger but not as bad as some of the ones posted here. I suspect this must boil down to Android SDK differences and compilers used. Could @mark8044 @mickyliu945 or anyone getting the huge APKs share their Flutter Doctor output? The android SDK for my Flutter setup is 33.0.0:
|
|
@luigi-rosso I have shared my Codemagic CI build with @mjtalbot My android SDK is 33.0.1
|
The librive_text.so decrease to 2.1M, upgrade ndk to "25.1.8937393" |
thank you @tarek360 for the codemagic repro, I've forked your sample & created a codemagic pipeline to repro the issue & I can confirm that updating the NDK fixes the bulk of the size increase, and brings us back to what we are seeing when building our sample project. & @mickyliu945 I am also able to confirm that upgrading the ndk resolves this size issue. even though I am seeing a smaller librive_text.so size, can you share what the analyze screenshot looks like for yours? I've forked your sample to https://github.com/mjtalbot/rive-demo, and started building releases on codemagic, the latest (with the fixed sizes is available here https://codemagic.io/app/63c535de9e9846469ee7d5a2/build/63c544b9e94b05b3719f3a5f) building against 0.9.1 results in updating the build.gradle this brings the librive_text.so size to 700-900kb per platform |
This may not be related, but could be part of the issue for some of you. See the hot fixes for the latest Flutter 3.7.3 - https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel In particular: Asset inclusion regression can cause unexpected app bundle size increase |
Unfortunately, still massive APK size with Flutter 3.7.3. Devs are saying the fix is to set a higher NDK version, but would prefer not to hardcode one in |
When integrating Rive in our CI I noticed a huge spike in build times. It turned out that it exceeded the cache limit of our service provider. I dived a bit more into it and noticed Rive's size in pub cache is huge. Is there a reason why this is so huge and how to optimize the size? Now Rive alone exceeds the cache limits of CI providers and dramatically slowing down our build times. When downgrading to v0.9.1 it is way less. |
@millerovv & @remonh87, which ndk version are you targeting? & do you get a warning like the following when you build? (if you have a flutter doctor output that would be helpful)
That being said I can reproduce the bloated cache size, so taking a look at what is causing this, but it looks like a separate issue to this, so i've filed a ticket for that here |
@mjtalbot I also used the same ndkVersion "25.1.8937393" in All in all this issue is less critical for our project, compared to 291, since for us size increase is not that "massive", but of course it's still there. |
@mjtalbot I can confirm I use the idk mentioned. I agree with splitting the issue 👍 |
I don't even use Rive, but for some reason, it appeared in my APK! changing the ndk version to |
Same here:
> flutter --version
Flutter 3.13.0-0.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision ac71592bc6 (3 weeks ago) • 2023-07-18 14:53:57 -0600
Engine • revision e14db68a86
Tools • Dart 3.1.0 (build 3.1.0-262.2.beta) • DevTools 2.25.0 > rive: 0.11.14
> rive_common: 0.2.6 DIFF: |
The added Text support for Text features should be optional and opt-in only when needed maybe as a standalone package or module |
I have the same issue here, from 62MB without any rive to 112MB with a little test animation (animation itself 16k)
I also have this ndk message issue:
On android studio the ndkVersion "25.1.8937393" version is already selected. And I already have the following to build.gradle: |
I found the solution, on my build.gradle I had already a "ndkVersion flutter.ndkVersion", which I didn't comment:
|
@echogit glad you solved it |
Is there a way to reduce weight without downgrading the rive and ndk version? |
HI @RenatTOP, could you please confirm if you can reproduce this with a new Flutter project. There is maybe some combination of your build environment that is going wrong. If you can reproduce it in a new sample app can you please share that and we can investigate. Some additional information you can share:
Also please ensure you're not also accidentally still setting |
the problem still persists, I made an minimal reproducible examle, its here its pretty much just the default app, added one animation, increased java version and ndk (as other dependencies require that) and build (on apple silicon) |
Windows machine here with the same issue. Ndk is 27.0.12077973 and after inspecting app size, 43.9MB is on librive_test.so |
For a bit of context in my case, this issue arose when my ndk changed from 25.1.8937393 to 27.0.12077973. |
Is anyone at Rive's side still looking into this? I have encountered the same issue, but, after diving a bit deeper, I discovered this piece of code in the rive_common source code:
So it seems a specific NDK version is hardcoded for the rive library, but can be overridden. When adding the rive.ndk.version property inside my project's gradle.properties to a version that aligns with my project (used 27.2.12479018, but I assume any version would work), the librive_text.so library's size decreased from 46.1 MB to 3.5 MB. A first look in my current animations did not seem to indicate anything broke because of this, but maybe it's a good idea for maintaining this version properly in the Rive code? |
Thanks for posting this @DelcoigneYves, |
same problem, app size went from 34mb to 218mb after including Rive package rive: ^0.13.20 with a minimal test animation |
My App APK hovers around
70MB
on 0.9.1. With the only change being a move to0.10.0
, the APK size grows to185MB
The text was updated successfully, but these errors were encountered: