• Stars
    star
    353
  • Rank 120,322 (Top 3 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created about 4 years ago
  • Updated 22 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A runtime for interactive animations on Android

Build Status Test Status Discord badge Twitter handle

Rive Android

Rive hero image

An Android runtime library for Rive.

The library is distributed through the Maven repository.

Table of contents

Rive Overview

Rive is a real-time interactive design and animation tool that helps teams create and run interactive animations anywhere. Designers and developers use our collaborative editor to create motion graphics that respond to different states and user inputs. Our lightweight open-source runtime libraries allow them to load their animations into apps, games, and websites.

๐Ÿก Homepage

๐Ÿ“˜ General help docs

๐Ÿ›  Learning Rive

Getting Started

Follow along with the link below for a quick start in getting Rive Android integrated into your multi-platform applications.

Getting Started with Rive in Android

Supported Versions

Currently, this runtime library supports a minimum SDK version of 21, and the target SDK version is 33.

Examples

Check out the app/ folder to see an example application using the Rive Android runtime. It showcases a number of ways to manipulate Rives, including:

  • How to include Rive files into the project and reference them
  • Setting layout and loop mode options
  • Displaying single or multiple animations / artboards on one component
  • Setting up and manipulating a state machine via inputs
  • Utilizing a low-level API to build a render loop for more control over scenes
  • ...and more!

Awesome Rive

For even more examples and resources on using Rive at runtime or in other tools, checkout the awesome-rive repo.

Experimental Features

The Rive renderer is available experimentally in 7.0.0.

Read more about the Rive Renderer here.

Please note that we don't recommend it for production builds yet as it's not fully compatible with the current Rive feature set (i.e., rendering images isn't supported yet). You might also encounter incompatibilities with specific devices - for example, the new renderer won't work on emulators just yet but only on physical devices.

Your feedback is greatly appreciated during this stage and we'd love to hear from you!

To use the new Rive renderer you can specify the parameter in XML:

<app.rive.runtime.kotlin.RiveAnimationView
  app:riveRenderer="Rive"
  โ€ฆ />

Alternatively, specify the renderer when initializing Rive:

Rive.init(applicationContext, defaultRenderer = RendererType.Rive)

This default value can still be overriden via XML.

Contributing

We love contributions! Check out our contributing docs to get more details into how to run this project, the examples, and more all locally.

Issues

Have an issue with using the runtime, or want to suggest a feature/API to help make your development life better? Log an issue in our issues tab! You can also browse older issues and discussion threads there to see solutions that may have worked for common problems.

Known Issues

After rive-android:6.0.0, CMake is building the library, and you might run into the following error when rive-android is used alongside other native libraries:

Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
โ€ฆ

You can fix this by adding this in your build.gradle:

android {
  โ€ฆ
  packagingOptions {
      pickFirst "lib/x86/libc++_shared.so"
      pickFirst "lib/x86_64/libc++_shared.so"
      pickFirst "lib/armeabi-v7a/libc++_shared.so"
      pickFirst "lib/arm64-v8a/libc++_shared.so"
  }
  โ€ฆ
}

Breaking Changes

7.0.0

  • RendererSkia is now called to Renderer