Skip to content

RuntimeException: Illegal callback invocation from native module #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
furlupe opened this issue Mar 26, 2025 · 0 comments
Open

RuntimeException: Illegal callback invocation from native module #45

furlupe opened this issue Mar 26, 2025 · 0 comments

Comments

@furlupe
Copy link

furlupe commented Mar 26, 2025

First of all, thank you for the library - it has been a good help in my apps! :)

But, sometimes I see a crash right after calling sendMessage:

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:26)
    at com.wearconnectivity.WearConnectivityModule.lambda$sendMessageToClient$0(WearConnectivityModule.java:107)
    at com.wearconnectivity.WearConnectivityModule$$ExternalSyntheticLambda0.onSuccess
    at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@18.1.0:1)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:246)
    at android.app.ActivityThread.main(ActivityThread.java:8653)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Unfortunately, I couldn't come up with a reproducible example, since it looks like it's happening during some obscure re-rendering or whatnot.

As far as I understand, the error rises when calling onSuccess \ onFailure callbacks (which are provided to the sendMessage method) from native side.

What could be done in that case? It does not occur often, but I still would like to get rid of it :)
Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant