Documentation Index
Fetch the complete documentation index at: https://rive-accessibility.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Web (JS)
React
React Native
Apple
Android
The majority of the size is the WASM library, which the table below represents.
Using: brotli -9 for compression.| Runtime | Uncompressed | Compressed |
|---|
| canvas-lite | 707KB | 222KB |
| canvas | 1728KB | 567KB |
| webgl2 | 2179KB | 648KB |
See Web (JS) for more details.
See Android and Apple for more details.
The following table shows the download and install size impact of adding RiveRuntime to your project,
calculated by comparing the App Thinning report for an empty iOS app with and without RiveRuntime.| Platform | Download Size Impact | Install Size Impact |
|---|
| Universal | ~1.67MB | ~4.66mb |
| Target | Download Size | Install Size |
|---|
| ARM-v8a | 2.40MB | 7.03MB |
| ARM-v7a | 2.32MB | 6.00MB |
Components
Rive Android’s binary size is comprised of a number of components:
- Kotlin code compiled to a DEX file
- Rive Android native shared library (
librive-android.so)
- C++ standard library (shared .so file - 394KB download size, 1.2MB install size for ARM-v8a)
- The following Android dependencies:
| Dependency | Reason |
|---|
| Compose: runtime, ui, ui-android | Compose support |
| Lifecycle: runtime-ktx and runtime-compose | Lifecycle awareness in Compose |
| Startup: startup-runtime | Automatic initialization |
| ReLinker | Rive native library loading |
| Volley | Network loading |
Amortization and R8
The sizes listed above reflect adding Rive to an otherwise empty application. Some of the above dependencies may already be present in your application, and as a result do not contribute to the size increase when adding Rive. For example, if your app already uses Jetpack Compose, the Compose dependencies will likely already be included in your app’s binary.The same is true for the C++ standard library, which will be shared across all dependencies with native code.Additionally, when compiling a release build, R8 will minify your application, removing unused code and resources. This can further reduce the size impact of adding Rive to your application. Ensure your Gradle file contains isMinifyEnabled = true.Future Work
There are options available to reduce the binary size of the library that can be considered for future work, including:
- Replacing Miniaudio with Oboe for audio support
- Modularizing the runtime to allow including Compose support only when needed, and separating the Compose API from the Legacy API
- Making Volley an opt-in dependency for network loading
- Changing C++ compile flags to prefer size over speed (requires performance testing)
Third Party Dependencies
The common Rive C++ runtime includes a number of open source third party dependencies which contribute to its binary weight. These are:
| Dependency | Reason |
|---|
| HarfBuzz | Text rendering |
| Miniaudio | Audio support |
| SheenBidi | Bidirectional text support |
| Yoga | Layout |
| Luau Interpreter | Scripting Support |