Problem Statement:
I am trying to develop a React Native app that can play music. I ejected the project from Expo and implemented React Native Track Player. However, when I try running the app on an Android device, the build is successful, but the app does not run and throws the following error:
Error: Exception in HostObject::get for prop ‘TrackPlayerModule’:
com.facebook.react.internal.turbomodule.core.TurboModuleInteropUtils$ParsingException:
Unable to parse @ReactMethod annotation from native module method: TrackPlayerModule.add().
Details: Unable to parse JNI signature. Detected unsupported return class: kotlinx.coroutines.Job
Environment Details:
- React Native Version: 0.76.3
- React Native Track Player Version: 4.1.1
- Expo: Ejected to bare workflow
Steps Taken:
- Installed React Native Track Player using npm install –save react-native-track-player.
- Ejected from Expo to use the bare workflow.
- Followed the installation instructions provided in the React Native
Track Player documentation. - Verified that the project builds successfully.
- Encountered the above error when trying to run the app on an Android
device.
Expected Outcome: The app should run successfully on an Android device without throwing any errors.
Actual Outcome: The app crashes at runtime with the error mentioned above.
Question: How can I resolve this issue?
Any guidance or solutions would be greatly appreciated!
2
Answers
I am experiencing the same issue. I think it has to do with the package not being updated. I suggest you look for an alternative library or you downgrade your react native version.
unfortunately React Native Track Player does not support new RN architecture at the moment.
so you have to either disable it
or try to apply suggested patch in this github issue.
also you can find more information about this problem in this PR from RN team, but RNTP team is still working on it.
hope it helps.