This package, currently at stable version 9.8.2, provides a React Native runtime library for integrating real-time interactive animations created with the Rive design tool into iOS and Android applications. It acts as a wrapper around the native Rive iOS and Android runtimes, exposing a `Rive` component and a ref pattern for controlling animations and state machines within React Native. While actively maintained with frequent updates to synchronize with the native Rive SDKs and address critical bugs, this package is explicitly identified as a *legacy runtime*. The Rive team is actively promoting migration to a new, performance-optimized `@rive-app/react-native` (Nitro runtime), with a long-term goal for full transition to the new package. Its release cadence involves minor version bumps and bug fixes, typically related to native runtime synchronization and platform-specific build issues.
npm install rive-react-nativeVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to embed a Rive animation from a local asset (e.g., 'truck_delivery_loop.riv') in a React Native component, including basic autoplay, specifying artboards/animations, and interacting with the Rive component via a ref.
Refer to the official Rive documentation and the `@rive-app/react-native` GitHub repository for migration guides and new runtime usage. Plan to transition your existing projects.
Check the changelogs for `rive-android` and `rive-ios` linked in the `rive-react-native` release notes for each update. After upgrading, run `cd ios && pod update RiveRuntime` and perform a clean Android build (e.g., `cd android && ./gradlew clean && ./gradlew assembleDebug`).
Update your project's `Podfile` (iOS) to `platform :ios, '14.0'` and `build.gradle` (Android) to specify `minSdkVersion 21` and `targetSdkVersion 33` (or higher, as recommended by React Native).
For iOS, drag `.riv` files into your Xcode project and ensure they are part of a target's 'Copy Bundle Resources'. For Android, place `.riv` files in `android/app/src/main/res/raw/`. For Expo managed workflow, follow Expo's asset bundling guidelines. Paths with subfolders can be tricky on iOS Release builds, verify your setup.
Ensure your project-level `build.gradle` includes `mavenCentral()` in `allprojects { repositories { ... } }`. Then, clean your Android project by running `cd android && ./gradlew clean` and rebuild.Navigate to your `ios` project folder (`cd ios`) and run `pod install` or `pod update RiveRuntime`. Ensure your `Podfile` includes `use_native_modules!` and `pod 'RiveRuntime', :path => '../node_modules/rive-react-native'` (if manually linked).
Verify the animation name exactly matches what is defined in your Rive file (case-sensitive). You can use `riveRef.current.getAnimationNames()` to inspect all available animation names at runtime.
For React Native 0.60+, auto-linking should handle this. If it persists, try `npx react-native link rive-react-native`, ensure `new RiveReactNativePackage()` is present in your `MainApplication.java` (if linking manually or older RN), clean your Android build cache, and rebuild.