Skip to content
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

JNI DETECTED ERROR IN APPLICATION: JNI IsAssignableFrom called with pending exception java.lang.NoSuchMethodError: no non-static method "Lit/innove/BleManager;.setEventEmitterCallback(Lcom/facebook/react/bridge/CxxCallbackImpl;)V #1319

Open
mrenann opened this issue Jan 14, 2025 · 8 comments

Comments

@mrenann
Copy link

mrenann commented Jan 14, 2025

Before open an issue

  • Check the closed issues, your question maybe is not new.
  • We can't debug or reproduce hardware issue.
  • If the library is not working 99% you did something wrong, in the code, installation or in the phone permissions.

Describe the bug
when uses the ble-manager crashes the app on android 7

To Reproduce

  1. On android device or emulator with android 7
  2. execute and import some code with react-native-ble-manager
  3. ex:
    BleManager.checkState().then((state) =>
      setEnabledBluetooth(state == 'on')
    );

Expected behavior
Crashes the app and dont run

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: Emulator
  • OS: Android 7.0
  • react-native-ble-manager version: 12.1.2
  • react-native version: 0.76.6

Additional context
Add any other context about the problem here.

@barakataboujreich
Copy link

we are having the same issue with our production app, we received 2 crash reports on firebase from two different devices.
OS: Android 8.0
Device 1: Galaxy A5(2017)
Device 2: Mate 10 Lite

Error: Exception in HostFunction: java.lang.NoSuchMethodError: no non-static method "Lit/innove/BleManager;.setEventEmitterCallback(Lcom/facebook/react/bridge/CxxCallbackImpl;)V", stack: requireModule@1:132701 get@1:132765 anonymous@1:4437621 loadModuleImplementation@1:107965 guardedLoadModule@1:107488 metroRequire@1:107118 anonymous@1:4429715 loadModuleImplementation@1:107965 guardedLoadModule@1:107488 metroRequire@1:107118 anonymous@1:4429470 loadModuleImplementation@1:107965 guardedLoadModule@1:107488 metroRequire@1:107118 anonymous@1:1393375 loadModuleImplementation@1:107965 guardedLoadModule@1:107488 metroRequire@1:107118 anonymous@1:934127 loadModuleImplementation@1:107965 guardedLoadModule@1:107488 metroRequire@1:107118 anonymous@1:933480 loadModuleImplementation@1:107965 guardedLoadModule@1:107488 metroRequire@1:107118 anonymous@1:740623 loadModuleImplementation@1:107965 guardedLoadModule@1:107488 metroRequire@1:107118 anonymous@1:113851 loadModuleImplementation@1:107965 guardedLoadModule@1:107445 metroRequire@1:107118 global@1:106646

@barakataboujreich
Copy link

we are having another crash, i don't know if it is related to the same issue.
OS: Android 12.0
Device 1: Galaxy A03 Core
Device 2: Moto G Pure (XT2163DL)

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'void com.facebook.react.bridge.CxxCallbackImpl.invoke(java.lang.Object[])' on a null object reference
it.innove.NativeBleManagerSpec.emitOnDidUpdateState (NativeBleManagerSpec.java:46)
it.innove.BleManager.checkState (BleManager.java:722)
com.facebook.jni.NativeRunnable.run (NativeRunnable.java)
android.os.Handler.handleCallback (Handler.java:938)

@marcosinigaglia
Copy link
Member

Are you using the new architecture?

@barakataboujreich
Copy link

yeah sorry forgot to mention that.

RN version: 0.76.6
new architecture enabled
react-native-ble-manager: 12.1.2
on android 8.0 the crash is happening on any device.

on other android versions it is random, we have 10 users crashing on android 11,12 and 13

@marcosinigaglia
Copy link
Member

I think is a RN problem like facebook/react-native#48606

@barakataboujreich
Copy link

But this issue is only mentioning API 26 which is android 8. We are facing crashes with android 11, android 12, android 13 and since i last commented we received a crash on android 14. the error in stacktrace is different from the one on android 8. should i open a new issue?

meanwhile this is our discovery:
we installed a new RN 0,76,6 new architecture enabled. we generate a debug apk and install it on android 8 device no crash is happening.
we generate an apk in release mode, a crash is happening with the error mentioned in this issue

@marcosinigaglia
Copy link
Member

The issue is in the react-native part so is the more reasonable answer. Try this fix facebook/react-native#48009

@ryd0rz
Copy link

ryd0rz commented Feb 1, 2025

I am also having this issue in API version 26. I need help to implement the solution. I can't figure it out xd.

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

4 participants