rive-app / rive-android

A runtime for interactive animations on Android
https://rive.app
MIT License
332 stars 30 forks source link

Increased Android Project Size after Integrating Rive SDK #298

Open MuhHarisPK opened 10 months ago

MuhHarisPK commented 10 months ago

I am experiencing an issue with my Android project where the project size has increased significantly after integrating the Rive SDK (formerly known as Flare). Prior to integrating the Rive SDK, my project size was within an acceptable range, but after adding the SDK, the size has increased beyond expectations.

avadhbsd commented 10 months ago

Thanks for posting this here Haris, can you please add the numbers as well so it can be confirmed if the increase in size is expected or if it indicates any other issues.

MuhHarisPK commented 10 months ago

yes @avadhbsd , Increased APK Size up to 12MB from the Current Size after Integrating Rive SDK. The original APK size was 37.5 MB, and the new APK size is 50.3 MB, resulting in a size difference of 12.8 MB. This indicates a 34% increase in the current APK size. :rocket: :worried:

umberto-sonnino commented 10 months ago

Hi @MuhHarisPK, our library is ~10.8MB in its latest iteration, but that takes into account multiple architectures which should get stripped out by Google Play when downloading the APK directly from the Play Store. We currently support 4 different architectures, so on average the Rive library should add ~2.5MB to your final APK.

Please provide a few more details here:

MuhHarisPK commented 10 months ago

Hi @umberto-sonnino -> We've built the release using version 7.0.0. Is this the latest version?

Regarding another issue: I can't seem to locate the animationView.getTextRunValue("name") method for handling dynamic text in this version 7.0.0.

umberto-sonnino commented 10 months ago

Hi @umberto-sonnino -> We've built the release using version 7.0.0. Is this the latest version?

Regarding another issue: I can't seem to locate the animationView.getTextRunValue("name") method for handling dynamic text in this version 7.0.0.

The latest version is 8.2.2(Sonatype link) Anything blocking you from upgrading to that? Some Text APIs aren't available until v8

MuhHarisPK commented 9 months ago

@umberto-sonnino no blocker, please update the doc. that's why we facing confusion about the latest version. is version 8.2.2 stable? Is there any critical crash on this version?

umberto-sonnino commented 9 months ago

@umberto-sonnino no blocker, please update the doc. that's why we facing confusion about the latest version. is version 8.2.2 stable? Is there any critical crash on this version?

You can find the latest version of the library either on Sonatype or via the GitHub repo tags, the latest stable version is the one at the top and currently it's 8.2.3.

PhilippNowak96 commented 7 months ago

Just dropping some comment here because we also came across this recently: APK Analyzer of Android Studio tells the following numbers in a release build APK:

We are currently using version 8.5.0.

Are these numbers expected? Since they seem to be twice as high as they should be in total (20 MB instead of 10 MB)

rcgonzalezf commented 4 months ago

This is still an issue with the latest SDK, it will be great if Rive devs can squeeze more bytes since it impacts consumers of the library. Just adding an idea here, that a potential solution could be to break the SDK in multiple pieces so consumers can only use what they need reducing the overall impact even with App Bundles, and release variants.