We love contributions! If you want to run the project locally to test out changes, run the examples, or just see how things work under the hood, read on below.
This is the main module of our android library, you can find a useful RiveAnimationView
or RiveArtboardRenderer
in the app.rive.runtime.kotlin
namespace.
The underlying C++ runtime is mapped to objects in
the app.rive.runtime.kotlin.core
namespace. These allow more fine grained control for more complex
animation loops. Our high level views are simply built on top of this.
This runtime is built on top of our C++ runtime. This is
included as a submodule in /submodules
. The /cpp
folder contains the C++ side of our Android bindings and is located at /kotlin/src/main/cpp
Multiple sample activities can be found here, this can be a useful reference for getting started with using the runtimes.
Open the project in Android Studio and ensure the app
build variant is set to debug
(or manually update the dependencies to use the local Rive runtime as a resource) and that you can run "Make Project" to run the Gradle build.
In Android Studio, to select which build variant to build and run, go to Build > Select Build Variant and select a build variant from the menu.
When making any changes to the source code, or even updating the .so
build files in the project,
run the test suite:
- Open the project in Android Studio
- Select the "Project" view (upper-right corner)
- Right-click on
kotlin/src/androidTest
and select "Run All Tests"
The runtime here should be updated to point to the latest rive-runtime
submodule when that runtime has
new commits merged in. This ensures the rive-android
project is up-to-date with its underlying
native code layer to pull in latest patches, features, and more. In most cases, when new rive-runtime
changes are introduced, we need to build new .so
files for different architectures.
- Install Ninja -
brew install ninja
- Download Premake5, and add it to your PATH
The Android NDK builds .so
files
for different architectures.
The current NDK version we're using is stored in .ndk_version. Rive is
constantly making use of the latest clang features, so please ensure your NDK is up to
date. (How to install a specific NDK version)
Make sure you're rebuilding the native libraries when pulling in the latest changes from rive-runtime
:
cd kotlin/src/main/cpp/
# Add NDK_PATH variable to your .zshenv
NDK_VERSION=$(tr <.ndk_version -d " \t\n\r")
echo 'export NDK_PATH=~/Library/Android/sdk/ndk/${NDK_VERSION}' >> ~/.zshenv
source ~/.zshenv
# Back to the top of the repo
cd -
# Make sure everything still builds
./gradlew assembleDebug
# After the script above completes successfully, commit your changes
git add .