Skip to content

Compose Preview in Android Studio does not work #413

@WonderCsabo

Description

@WonderCsabo

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriage

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions