rive-app / rive-app/rive-android
Compose Preview in Android Studio does not work
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.