Compose Preview in Android Studio does not work

Đang mở
#413 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@ErikUggeldahl đang làm issue này rồi.

Từ ngày 22/9/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug triage
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.

Ngôn ngữ chính
Kotlin
Star
545
Fork
69
Merge trung bình
19 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rive-app/rive-android

Tất cả issue của rive-app/rive-android

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.