Closed Buthrakaur closed 1 month ago
related issue from the original repository: https://github.com/viromedia/viro/issues/1004
I just tried current version of viro-starter-kit with latest viro release (react-viro 2.41.0) and the issue still persist - the exception is a bit different now though:
java_vm_ext.cc:591] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/media3/exoplayer/trackselection/DefaultTrackSelector;
java_vm_ext.cc:591] at void com.viro.core.internal.AVPlayer.<init>(long, android.content.Context) (AVPlayer.java:91)
java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.runTask(int) (PlatformUtil.java:-2)
java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.-$$Nest$smrunTask(int) (PlatformUtil.java:-1)
java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil$TaskRunnable.run() (PlatformUtil.java:97)
java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1502)
java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1272)
java_vm_ext.cc:591] Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.media3.exoplayer.trackselection.DefaultTrackSelector" on path: DexPathList[[zip file "/data/app/~~JeBeBXFe1Yr4iL_tu48CFA==/com.virostarterkit-TSBOdFAY987HZPWdvzrzTw==/base.apk"],nativeLibraryDirectories=[/data/app/~~JeBeBXFe1Yr4iL_tu48CFA==/com.virostarterkit-TSBOdFAY987HZPWdvzrzTw==/lib/arm64, /data/app/~~JeBeBXFe1Yr4iL_tu48CFA==/com.virostarterkit-TSBOdFAY987HZPWdvzrzTw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
java_vm_ext.cc:591] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:259)
java_vm_ext.cc:591] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
java_vm_ext.cc:591] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
java_vm_ext.cc:591] at void com.viro.core.internal.AVPlayer.<init>(long, android.content.Context) (AVPlayer.java:91)
java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.runTask(int) (PlatformUtil.java:-2)
java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.-$$Nest$smrunTask(int) (PlatformUtil.java:-1)
java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil$TaskRunnable.run() (PlatformUtil.java:97)
java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1502)
java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1272)
java_vm_ext.cc:591]
java_vm_ext.cc:591] in call to NewGlobalRef
java_vm_ext.cc:591] from void com.viro.core.internal.PlatformUtil.runTask(int)
Hello @robertjcolley , could you please review the PR https://github.com/NativeVision/virocore/pull/154 and possibly release new react-viro version with the fix?
@Buthrakaur I've just emailed you the module that I managed to get working with your fix. You helped me a lot
Currently having this issue on my expo dev build app. I don't get any error message, the app just crashes.
Hi @Dani2097 , I'm struggling to find the email from you - could you please mention your email address or post the message simply here?
I just tried current version of viro-starter-kit with latest viro release (react-viro 2.41.0) and the issue still persist - the exception is a bit different now though:
java_vm_ext.cc:591] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/media3/exoplayer/trackselection/DefaultTrackSelector; java_vm_ext.cc:591] at void com.viro.core.internal.AVPlayer.<init>(long, android.content.Context) (AVPlayer.java:91) java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.runTask(int) (PlatformUtil.java:-2) java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.-$$Nest$smrunTask(int) (PlatformUtil.java:-1) java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil$TaskRunnable.run() (PlatformUtil.java:97) java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1502) java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1272) java_vm_ext.cc:591] Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.media3.exoplayer.trackselection.DefaultTrackSelector" on path: DexPathList[[zip file "/data/app/~~JeBeBXFe1Yr4iL_tu48CFA==/com.virostarterkit-TSBOdFAY987HZPWdvzrzTw==/base.apk"],nativeLibraryDirectories=[/data/app/~~JeBeBXFe1Yr4iL_tu48CFA==/com.virostarterkit-TSBOdFAY987HZPWdvzrzTw==/lib/arm64, /data/app/~~JeBeBXFe1Yr4iL_tu48CFA==/com.virostarterkit-TSBOdFAY987HZPWdvzrzTw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] java_vm_ext.cc:591] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:259) java_vm_ext.cc:591] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379) java_vm_ext.cc:591] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) java_vm_ext.cc:591] at void com.viro.core.internal.AVPlayer.<init>(long, android.content.Context) (AVPlayer.java:91) java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.runTask(int) (PlatformUtil.java:-2) java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil.-$$Nest$smrunTask(int) (PlatformUtil.java:-1) java_vm_ext.cc:591] at void com.viro.core.internal.PlatformUtil$TaskRunnable.run() (PlatformUtil.java:97) java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1502) java_vm_ext.cc:591] at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1272) java_vm_ext.cc:591] java_vm_ext.cc:591] in call to NewGlobalRef java_vm_ext.cc:591] from void com.viro.core.internal.PlatformUtil.runTask(int)
You need to use new dependcy on Android def media3_version = "1.3.1"
// For media playback using ExoPlayer implementation "androidx.media3:media3-exoplayer:$media3_version"
the PR https://github.com/NativeVision/virocore/pull/154 with fix was already merged so I'm closing this - waiting for release though
Requirements:
Please go through this checklist before opening a new issue
Environment
Please provide the following information about your environment:
@viro-community/react-viro
2.23.0 and React Native 0.71.3. We don't specify exoplayer version in ourbuild.gradle
file so it's picked up from viro.Description
The app crashes when
ViroVideo
component is added to the AR scene with an exception:There was a breaking change in exoplayer2 in the
AdaptiveTrackSelection.Factory
method which was handled in this commit: https://github.com/ViroCommunity/virocore/commit/6bad81c71f2de770a2415d03c1b912111da8e1d1 but it looks like react-viro somehow didn't get the virocore version with this change even though it was merged into virocore years ago and links exoplayer version AFTER the breaking change which causes the exception and app crash. I tried to understand versioning of virocore vs react-viro but I must admit I got completely lost. I believe the is some mismatch between react-viro and virocore versions.Reproducible Demo
@viro-community/react-viro@2.23.0
ViroVideo
component