-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Describe the bug
The Android app crashes immediately when initializing or playing media through JWPlayer React Native SDK. The crash occurs due to a method incompatibility between JWPlayer SDK and AndroidX Media3, specifically regarding the PlayerMessage.setHandler method. This is a blocking issue preventing any audio playback functionality in our production app.
To Reproduce
Steps to reproduce the behavior:
- Create a React Native project with Expo
- Install @jwplayer/jwplayer-react-native
- Configure JWPlayer with proper Media3 dependencies in Android configuration
- Set up a basic audio player using JWPlayer
- Attempt to play any audio stream
- App crashes with NoSuchMethodError
Expected behavior
- JWPlayer should initialize successfully
- Audio playback should work without crashes
- Player controls and events should function normally
Screenshots / Visual evidence
Title: [Android] Critical: JWPlayer React Native SDK Crashes Due to Media3 PlayerMessage.setHandler Incompatibility
java.lang.NoSuchMethodError: No virtual method setHandler(Landroid/os/Handler;)Landroidx/media3/exoplayer/PlayerMessage; in class Landroidx/media3/exoplayer/PlayerMessage; or its super classes (declaration of 'androidx.media3.exoplayer.PlayerMessage' appears in /data/app/~~EH-gSvtI9j7TSoNh2SHl3w==/com.mediaworks.therock.beta-qMDl2X3uwuwArtS8vxWDjA==/base.apk!classes6.dex)
To Reproduce
Steps to reproduce the behavior:
- Create a new React Native project with Expo
- Add the following dependencies:
- @jwplayer/jwplayer-react-native
- Required Android configuration in app.config.ts
- Initialize JWPlayer with a simple audio configuration:
- Run the app on any Android device
- App crashes immediately when the JWPlayer component mounts or when attempting to play audio playlist
"streamUrl": "https://example-url/playlist.m3u8",
Desktop:
Build Environment:
- macOS darwin 24.3.0
- Android Gradle plugin: 8.6.0
- Gradle: 8.10.2
- React Native with Expo managed workflow
- Node.js version: 20.17.0
Device(s) affected
- Reproducible on all tested Android devices:
- Android Emulator (API 30, 31, 33)
- Physical devices running Android 11-14
- Both ARM and x86 architectures
- Reproduction rate: 100%
Additional context
Attempted Solutions:
-
SDK Versions:
- JWPlayer SDK versions: 4.19.0, 4.18.4, 4.6.0
- Media3 versions: 1.4.1, 1.1.1, 1.0.0
- All combinations result in the same error
-
Configuration Attempts:
- Implemented all recommended Android configurations
- Added complete Media3 dependency set
- Configured proper Maven repository
- Enabled multiDex
- Set appropriate SDK versions
- Disabled advanced features (background playback, lock screen controls)
-
Project Setup:
// app.config.ts android: { extraMavenRepos: ['https://mvn.jwplayer.com/content/repositories/releases/'], minSdkVersion: 24, targetSdkVersion: 34, compileSdkVersion: 34, multiDexEnabled: true, // Downgraded Media3 dependencies: 'androidx.media3:media3-common:1.1.1', 'androidx.media3:media3-extractor:1.1.1', 'androidx.media3:media3-exoplayer:1.1.1', 'androidx.media3:media3-exoplayer-dash:1.1.1', 'androidx.media3:media3-exoplayer-hls:1.1.1', 'androidx.media3:media3-exoplayer-smoothstreaming:1.1.1', 'androidx.media3:media3-session:1.1.1', 'androidx.media3:media3-datasource-okhttp:1.1.1', 'androidx.media3:media3-ui:1.1.1', // JWPlayer dependencies: 'com.jwplayer:jwplayer-core:4.18.4', 'com.jwplayer:jwplayer-common:4.18.4', 'com.jwplayer:jwplayer-ima:4.18.4', 'com.jwplayer:jwplayer-chromecast:4.18.4', // Other dependencies: 'com.squareup.picasso:picasso:2.71828', 'androidx.viewpager2:viewpager2:1.0.0', 'com.android.volley:volley:1.2.0', 'androidx.recyclerview:recyclerview:1.2.1', 'androidx.appcompat:appcompat:1.3.1', 'com.google.android.material:material:1.4.0', 'androidx.constraintlayout:constraintlayout:2.0.4', ], }
Critical Questions:
- Is there a known working combination of JWPlayer SDK and Media3 versions for React Native?
- Are there specific configuration requirements for Media3 compatibility?
- Is there a workaround available for the
setHandler
method issue? - Would using ExoPlayer 2.x instead of Media3 be a viable solution?