Cause of a OutOfMemoryError with React native Android - android

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

Related

Jetpack Compose: AccessibilityInteractionController.java exception

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

Godot AdMob NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd

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)

Cannot connect to android.support.test.orchestrator.OrchestratorService

Not able to run instrumentation test with android orchestrator,
I have followed developer doc and made same changes but it's not working.
Screen shot and logs are attached.
Any help would be appreciated thanks in advance
Logcat:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ctpl.myinstrumentationtest, PID: 6608
java.lang.RuntimeException: Exception thrown in onCreate() of ComponentInfo{com.example.ctpl.myinstrumentationtest.test/android.support.test.runner.AndroidJUnitRunner}: java.lang.RuntimeException: Cannot connect to android.support.test.orchestrator.OrchestratorService
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5868)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
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)
Caused by: java.lang.RuntimeException: Cannot connect to android.support.test.orchestrator.OrchestratorService
at android.support.test.orchestrator.instrumentationlistener.OrchestratedInstrumentationListener.connect(OrchestratedInstrumentationListener.java:87)
at android.support.test.runner.AndroidJUnitRunner.onCreate(AndroidJUnitRunner.java:303)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5863)
at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
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) 
List item
I had the same problem but with androidx orchestrator. I was getting the same exception but the package was different:
Caused by: java.lang.RuntimeException: Cannot connect to androidx.test.orchestrator.OrchestratorService.
I have found the description of possbile root cause in this github thread. There's an iteresting discussion, but it seems that there's no general solution for this yet.
For me the problem was caused by setting the target sdk to 30 and launching the app on an android 30 emulator. So launching tests on emulator with api < 30 resolved this.

APP crashed when I installed the RN update

I integrate react-native-code-push to my RN project. But when I installed the update, the APP was crashed. Here is the source code.
2018-10-30 11:26:52.274 14122-14122/com.example.jason.rnandroid E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.jason.rnandroid, PID: 14122
java.lang.AssertionError: recreateReactContextInBackground should only be called after the initial createReactContextInBackground call.
at com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:72)
at com.facebook.react.ReactInstanceManager.recreateReactContextInBackground(ReactInstanceManager.java:339)
at com.microsoft.codepush.react.CodePushNativeModule$2.run(CodePushNativeModule.java:151)
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:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
I don't know how to solve this problem, can anyone help?

getting crash in react native app for android

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 ?

Categories

Resources