rive-app / rive-flutter

Flutter runtime for Rive
https://rive.app
MIT License
1.16k stars 180 forks source link

Exported app size increases with rive 0.13.0 #367

Open Amir-P opened 3 months ago

Amir-P commented 3 months ago

Description

Upgrading rive from 0.12.4 to 0.13.0, resulted in a huge jump in APK size (about 1.8 MB for android-arm64). Looking at the details I can see this is caused by librive_text.so.

Is there any way to opt-out of text and audio engine?

Device & Versions

Flutter 3.16.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 41456452f2 (7 weeks ago) • 2024-01-25 10:06:23 -0800
Engine • revision f40e976bed
Tools • Dart 3.2.6 • DevTools 2.28.5
HayesGordon commented 3 months ago

Hi @Amir-P are you setting the ndk-version to:

ndkVersion "25.1.8937393"

See docs here: https://github.com/rive-app/rive-flutter/blob/master/platform_considerations.md#android

Amir-P commented 3 months ago

Hi @Amir-P are you setting the ndk-version to:


ndkVersion "25.1.8937393"

Hi @HayesGordon. Yes, I'm using the exact same version of NDK in my Android project.

HayesGordon commented 3 months ago

Hey @Amir-P, I can confirm what you're seeing. This release is a build-up in preparation for new features that are launching, which are included in those libraries. We'll investigate this size increase and get back to you.

For now I recommend downgrading back to a previous version. Apologies for the inconvenience.

To answer your question about opting out of text + audio, this is something that is already a feature request. But we've not yet planned for this work.

Fudal commented 2 weeks ago

@HayesGordon do you know more about that issue? Will be fixed?

itsJoKr commented 5 days ago

We are also waiting for the update. The Rive adds an insane 176 MB to our APK size (we need to use APK for specific reasons).

EDIT: Actually this was without specific ndk version. With it it's 26 MB increase which is still a lot but more reasonable.

HayesGordon commented 5 days ago

@itsJoKr could you share a sample project that reproduces this. And provide more information on your build environment and which version of Flutter you're using.

In our testing librive_text.so is around ~1.3 mb. Which accounts for the majority of the size of adding the Rive package.

@Amir-P can you confirm if you're still seeing the big jump. On our side going from version 0.12.0 to 0.13.7 is around 0.4mb increase.

Amir-P commented 2 days ago

@HayesGordon I still see an increase in APK size. Here's is the exact numbers for fat APK with different rive versions:

Without rive: 38.3MB
0.9.1: 38.8MB
0.12.0: 42.9MB
0.13.7: 44.7MB

As you can see depending on version 0.9.1 adds 0.5MB in total but just upgrading from 0.9.1 to 0.13.7 adds about 5.9MB!