Loading sounds fails in Android 12 with the following error:
2021-09-02 11:38:18.733 13747-13921/org.jitsi.meet D/FileUtils: Failed to convert to modern format file descriptor
java.io.IOException: Input file descriptor already original
at android.provider.MediaStore.getOriginalMediaFormatFileDescriptor(MediaStore.java:943)
at android.os.FileUtils.convertToModernFd(FileUtils.java:1470)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1274)
at com.zmxv.RNSound.RNSoundModule.createMediaPlayer(RNSoundModule.java:186)
at com.zmxv.RNSound.RNSoundModule.prepare(RNSoundModule.java:61)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
at java.lang.Thread.run(Thread.java:920)
:beetle: What is the observed behavior?
The above error is printed in logcat, and no sound is played.
:beetle: What is the expected behavior?
Get no error and the sound to be played.
:beetle: Please post your code:
N/A.
:bulb: Does the problem have a test case?
Not really, any sample project should have the same behavior, when run in Android 12.
:bulb: Possible solution
I don't know.
:bulb: Is there a workaround?
Not that I know of.
:bulb: If the bug is confirmed, would you be willing to create a pull request?
:beetle: Description
Loading sounds fails in Android 12 with the following error:
:beetle: What is the observed behavior?
The above error is printed in logcat, and no sound is played.
:beetle: What is the expected behavior?
Get no error and the sound to be played.
:beetle: Please post your code:
N/A.
:bulb: Does the problem have a test case?
Not really, any sample project should have the same behavior, when run in Android 12.
:bulb: Possible solution
I don't know.
:bulb: Is there a workaround?
Not that I know of.
:bulb: If the bug is confirmed, would you be willing to create a pull request?
I don't know how to fix it alas.
Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?