rive-android icon indicating copy to clipboard operation
rive-android copied to clipboard

Increased Android Project Size after Integrating Rive SDK

Open MuhHarisPK opened this issue 2 years ago • 9 comments

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.

MuhHarisPK avatar Aug 22 '23 09:08 MuhHarisPK

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.

avadhbsd avatar Aug 22 '23 10:08 avadhbsd

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:

MuhHarisPK avatar Aug 22 '23 10:08 MuhHarisPK

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:

  • Did you build for debug or release?
  • Which version are you currently using?
  • Could you confirm if this is a Play Store APK or one that you built locally?

umberto-sonnino avatar Aug 23 '23 10:08 umberto-sonnino

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.

MuhHarisPK avatar Aug 24 '23 05:08 MuhHarisPK

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

umberto-sonnino avatar Aug 24 '23 14:08 umberto-sonnino

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

MuhHarisPK avatar Sep 07 '23 06:09 MuhHarisPK

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

umberto-sonnino avatar Sep 07 '23 11:09 umberto-sonnino

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:

  • x86: 5.9 MB
  • x86_64: 5.9 MB
  • arm64-v8a: 5.3 MB
  • armeabi-v7a: 4.4 MB

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)

PhilippNowak96 avatar Nov 09 '23 07:11 PhilippNowak96

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.

rcgonzalezf avatar Feb 26 '24 17:02 rcgonzalezf