viromedia/viro

Video crashes on Android due to some wrong exoplayer2 dependency

Buthrakaur opened this issue · 0 comments

Environment

  1. Development OS: Mac, Windows
  2. Device OS & Version: Android 14
  3. Version: ViroReact version 2.23.1 and React Native version 0.71.3
  4. Device(s): Google Pixel 7A (Android 14)

Description

The app crashes when using a simple ViroVideo component with any video and no specific settings:

java.lang.NoSuchMethodError: No direct method <init>(Lcom/google/android/exoplayer2/upstream/BandwidthMeter;)V 
  in class Lcom/google/android/exoplayer2/trackselection/AdaptiveTrackSelection$Factory; or its super classes (declaration of 'com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection$Factory' appears in /data/app/~~w_ah16GTD9rXZlbGVbjXvw==/org.smart_guide.smartguide.T_00007-JIfgNEWRCUEvF3YUu5IqKw==/base.apk!classes2.dex)
  at void com.viro.core.internal.AVPlayer.<init>(long, android.content.Context) (AVPlayer.java:98)
  at void com.viro.core.internal.PlatformUtil.runTask(int) (PlatformUtil.java:-2)
  at void com.viro.core.internal.PlatformUtil.access$000(int) (PlatformUtil.java:77)
  at void com.viro.core.internal.PlatformUtil$TaskRunnable.run() (PlatformUtil.java:97)
  at void android.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1502)
  at void android.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1272)

related code change when trying to understand the root cause of the crash

virocore changed AVPlayer code from new AdaptiveTrackSelection.Factory(new DefaultBandwidthMeter()); to new AdaptiveTrackSelection.Factory() in this commit: NativeVision/virocore@6bad81c (Sep 4, 2021) migrating from exoplayer 2.7.1 to 2.13.3, but it probably somehow didn't make it into current master and 2.23.1

Reproducible Demo

Nothing special needed - just use ViroVideo on Android in the AR scene and run the app.