[Android] java.lang.RuntimeException - Possible Race Condition
See original GitHub issueI’ve just observed this Crash in the wild - i could imagine that it could be some sort of Race Condition or maybe both - onError and onCompletion - is called at a certain condition.
Fatal Exception: java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:32)
at com.zmxv.RNSound.RNSoundModule$1.onCompletion(RNSoundModule.java:81)
at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:2538)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:818)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:32 (10 by maintainers)
Top Results From Across the Web
Possible race condition. Quick rotations result in crash. #98
run(HandlerThread.java:61) Caused by: java.lang.RuntimeException: Camera is being used after Camera.release() was called at android.hardware.
Read more >How can we get NPE, race condition - Stack Overflow
First, let's change the name of the variable; List<Object> list=new ArrayList<>(); because "obj" is a really awful name for a variable that ...
Read more >[android-developers] Possible race condition whlie installing an ...
I just got an interesting exception on my Galaxy Nexus while doing the usual change-compile-debug cycle with Eclipse: 01-21 02:19:03.340 E/AndroidRuntime( ...
Read more >SDK auto-download: race condition when building two ...
This is still an issue on Android Plugin 2.3, and it happens whenever two Android builds try to download Android SDK components at...
Read more >Compose Runtime - Android Developers
If you are using Android Studio Bumblebee Canary 4 or AGP 7.1.0-alpha04 / 7.1.0-alpha05 ... Fixed race conditions in SnapshotStateObserver causing spurratic ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Faced the same issue and figured out that this only happens (so far is I could check this for now) when two ore more sounds are played at the same time. So I used the callback of
play
to workaround this in my js code - maybe this will help you:../helper/Sound.js
:So in my case I can call
Sound.flashLightOn()
(import Sound from '../helper/Sound';
) as often as I want but it is only one sound played at the same time - this seems to workaround this issue.@henrikra there you go, submitted PR #202