in our react native app we have used firebase, and location services .
here we are getting crash in react native and its very difficult to understand and reproduce it.
here is the crash.
Fatal Exception: java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:152)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1285)
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:458)
at io.invertase.firebase.firestore.RNFirebaseFirestoreTransactionHandler.safeUnlock(RNFirebaseFirestoreTransactionHandler.java:160)
at io.invertase.firebase.firestore.RNFirebaseFirestoreTransactionHandler.abort(RNFirebaseFirestoreTransactionHandler.java:50)
at io.invertase.firebase.firestore.RNFirebaseFirestore.transactionDispose(RNFirebaseFirestore.java:281)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
how to check the cause of this crash in react native ?
Related
I released my app to Google Play and I can see a lot of fatal exceptions being logged to crashlytics, the stack trace is:
Fatal Exception: java.lang.NullPointerException
at androidx.compose.ui.node.DelegatableNodeKt.requireCoordinator-64DMado(DelegatableNodeKt.java:295)
at androidx.compose.ui.semantics.SemanticsNode.findCoordinatorToGetBounds$ui_release(SemanticsNode.kt:356)
at androidx.compose.ui.semantics.SemanticsNode.getSize-YbymL2g(SemanticsNode.java:115)
at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.performActionHelper(AndroidComposeViewAccessibilityDelegateCompat.java:1358)
at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.access$performActionHelper(AndroidComposeViewAccessibilityDelegateCompat.java:117)
at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat$MyNodeProvider.performAction(AndroidComposeViewAccessibilityDelegateCompat.android.kt:2451)
at android.view.AccessibilityInteractionController.performAccessibilityActionUiThread(AccessibilityInteractionController.java:612)
at android.view.AccessibilityInteractionController.-wrap6(AccessibilityInteractionController.java)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1228)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6942)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
or
Fatal Exception: java.lang.NullPointerException
at androidx.compose.ui.node.DelegatableNodeKt.requireCoordinator-64DMado(DelegatableNodeKt.java:295)
at androidx.compose.ui.semantics.SemanticsNode.findCoordinatorToGetBounds$ui_release(SemanticsNode.kt:356)
at androidx.compose.ui.semantics.SemanticsNode.getSize-YbymL2g(SemanticsNode.java:115)
at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.performActionHelper(AndroidComposeViewAccessibilityDelegateCompat.java:1358)
at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.access$performActionHelper(AndroidComposeViewAccessibilityDelegateCompat.java:117)
at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat$MyNodeProvider.performAction(AndroidComposeViewAccessibilityDelegateCompat.android.kt:2451)
at android.view.AccessibilityInteractionController.performAccessibilityActionUiThread(AccessibilityInteractionController.java:708)
at android.view.AccessibilityInteractionController.access$500(AccessibilityInteractionController.java:67)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1327)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6704)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:916)
that's all I can see in the logs.. As you can see, the stacktrace does not have any code that belongs to my app, so there's no place where I can put a try/catch for example and I can't even reproduce this.
Any idea on how to fix this or at least reproduce the issue?
This app release was built with compose v1.3, but I could see logs from 1.3-beta as well...
Any help would be appreciated.
The following release(s) address this bug.
androidx.compose.ui:ui:1.4.0-alpha05
Source: https://issuetracker.google.com/issues/258907850
I got this error trying to setup Revenue Cat Purchases 3.4.3 on React Native.
RN 0.67
2022-02-28 07:58:39.154 5945-8093/com.farms E/unknown:ReactNative: Exception in native call
java.lang.IllegalStateException: Method addObserver must be called on the main thread
at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:317)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:172)
at com.revenuecat.purchases.Purchases.(Purchases.kt:160)
at com.revenuecat.purchases.Purchases$Companion.configure(Purchases.kt:1593)
at com.revenuecat.purchases.Purchases$Companion.configure$default(Purchases.kt:1560)
at com.revenuecat.purchases.common.CommonKt.configure(common.kt:271)
at com.revenuecat.purchases.react.RNPurchasesModule.setupPurchases(RNPurchasesModule.java:73)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:237)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:919)
Anyone faced it? Thanks!
EDIT:
Ok! Updating to react-native-purchases 4.5.2 solves the problem!
I'm trying to export and run Godot project on Android emulator, but after splash screen, it immediately crash.
I'm using ShinNil plugin (https://github.com/Shin-NiL/Godot-Android-Admob-Plugin) to display ads.
Here is the logcat message. I've tried to find this error on internet but no solutions work. Am I missing something?
Does anyone has faced this issue before, pls help me out.
Process: org.godotengine.xxx, PID: 9674
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd;
at shinnil.godot.plugin.android.godotadmob.Interstitial.<init>(Interstitial.java:25)
at shinnil.godot.plugin.android.godotadmob.GodotAdMob$8.run(GodotAdMob.java:394)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I'm developping an app with React native and my last version in release mode crashes after 20-30 seconds with the following generated logcat:
02-19 23:52:10.777 32717-32717/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: my.app, PID: 32717
java.lang.OutOfMemoryError: std::bad_alloc
at com.facebook.react.bridge.WritableNativeArray.pushInt(Native Method)
at com.facebook.react.modules.core.Timing$TimerFrameCallback.doFrame(Timing.java:89)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:134)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:105)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:655)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
The app never crashes in dev mode.
How can I know what causes this? Is there a leak somewhere? What steps are to be followed to know more about it?
android/app/src/main/AndroidManifest.xml
<application
android:largeHeap="true"
Adding largeHeap seems fix it
Please refer this git issue
This is a stack trace from crashlytics in my react native app, it happens quite often and is the top crash by volume by far.
I'm not really sure where to begin investigating this? Does anyone have any ideas?
This happens on Android, using react native 0.55
Fatal Exception: java.lang.RuntimeException: Error invoking callback 520
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:145)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Caused by com.facebook.jni.CppException: Failed to create Value from JSON:
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:145)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Using fetch() and then doing response.json() when the server sends
malformed JSON causes a crash.Use axios as web client to call api.
If you are using react-native-fetch-blob and react-native-cached-image then also this error occur as fetch-blob using fecth() method.