rive-app / rive-app/rive-android

Compose Preview in Android Studio does not work

Open
#413 1 comment 0 reactions 1 assignee View on GitHub

@ErikUggeldahl is already working on this.

Since Sep 22, 2025.

bug triage
Dominant language
Kotlin
Stars
538
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Description

If we use RiveUI() in our Composables, and check out the preview in Android Studio, the preview cannot render, and crashes.

java.lang.ClassNotFoundException: android.opengl.EGL14
  at java.lang.ClassLoader.loadClass  at java.lang.ClassLoader.loadClass  at app.rive.core.CommandQueue.<init>   ...
(CommandQueue.kt:434)
Provide a Repro

Just add any RiveUI() in your Composable:

val riveFileResult by rememberRiveFile(RiveFileSource.RawRes(R.raw.your_rive_animation))

if (riveFileResult is Result.Success) {
    val riveFile = (riveFileResult as Result.Success<RiveFile>).value

    RiveUI(
        file = riveFile
    )
}
Expected behavior

Preview should show the Rive animaton in its initial state. At least just show a blank view, and not crash the whole Composable preview.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.