I recently updated my dependencies, including updating androidx.appCompat from 1.2.0 to 1.3.0. It took some digging to figure out that this is what was causing my crash.
The crash doesn't occur until the user clicks on a MaterialCardView to transition to a new fragment on the home page.
Removing the dependency update resolved my issue. Does anyone know what in androidx.appcompat:appcompat:1.3.0 might be causing this? Here's the crash log:
java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
at java.util.ArrayList.get(ArrayList.java:437)
at f.m.c.s0.v(FragmentTransitionImpl.java:3)
at f.m.c.c.b(DefaultSpecialEffectsController.java:183)
at f.m.c.x0.c(SpecialEffectsController.java:23)
at f.m.c.b0.E(FragmentManager.java:81)
at f.m.c.b0.Z(FragmentManager.java:11)
at f.m.c.b0.C(FragmentManager.java:14)
at f.m.c.b0$g.run(FragmentManager.java:1)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:10)
at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:7)
at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:1)
at androidx.test.espresso.base.UiControllerImpl.injectMotionEvent(UiControllerImpl.java:6)
at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:6)
at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:1)
at androidx.test.espresso.action.Tap.sendSingleTap(Tap.java:5)
at androidx.test.espresso.action.Tap.access$100(Tap.java:1)
at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:1)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:4)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:2)
at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:19)
at androidx.test.espresso.ViewInteraction.access$100(ViewInteraction.java:1)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:2)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:6718)
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)
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'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 have a problem with my Android application. When I throw RuntimeException it causes ANR instead of crash.
For example, I have such code:
button.setOnClickListener {
throw RuntimeException("Test crash")
}
And when I click on this button aplication freezes for some time and then shows alert about ANR.
I have read similar question, otlined here: RuntimeException causes ANR instead of crash in android
But I can't figure out how to fix it. I checked everything I could: no UncaughtExceptionHandler-s attached, I do not use outdated google-play-services library. Where should I look for the cause of the problem?
Interesting thing that I can see stacktrace in logcat after I click this button:
2021-08-04 09:05:39.464 8764-8764/wa.testapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: wa.testapp, PID: 8764
java.lang.RuntimeException: Test crash
at com.example.testapp.ui.main.FragmentMain.onViewCreated$lambda-7(FragmentMain.kt:102)
at com.example.testapp.ui.main.FragmentMain.$r8$lambda$agRVJ2mByrrRLVPpioFH6VVBf9s(Unknown Source:0)
at com.example.testapp.ui.main.FragmentMain$$ExternalSyntheticLambda8.onClick(Unknown Source:0)
at android.view.View.performClick(View.java:7448)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2021-08-04 09:05:39.467 8764-8764/wa.testapp E/a: Exception:
message: Test crash
localized message: Test crash
stack trace:
java.lang.RuntimeException: Test crash
at com.example.testapp.ui.main.FragmentMain.onViewCreated$lambda-7(FragmentMain.kt:102)
at com.example.testapp.ui.main.FragmentMain.$r8$lambda$agRVJ2mByrrRLVPpioFH6VVBf9s(Unknown Source:0)
at com.example.testapp.ui.main.FragmentMain$$ExternalSyntheticLambda8.onClick(Unknown Source:0)
at android.view.View.performClick(View.java:7448)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I found a reason of such behaviour. The reason is a com.smartlook.recording:app:1.1.2-native dependency. After removing this library from project everything works fine.
So I have my first pre launch report from Android Studio, I have a bunch of unsupported API errors, eg ...
API (unsupported) Warning Issue 1 of 10 Called 3 times during testing API
Landroid/widget/AbsListView;->mIsChildViewEnabled:Z
Stack trace #1
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/widget/AbsListView;->mIsChildViewEnabled:Z
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/widget/AbsListView;->mIsChildViewEnabled:Z
at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
at java.lang.Class.getDeclaredField(Native Method)
at androidx.appcompat.widget.DropDownListView.(DropDownListView.java:123)
at androidx.appcompat.widget.MenuPopupWindow$MenuDropDownListView.(MenuPopupWindow.java:147)
at androidx.appcompat.widget.MenuPopupWindow.createDropDownListView(MenuPopupWindow.java:80)
at androidx.appcompat.widget.ListPopupWindow.buildDropDown(ListPopupWindow.java:1178)
at androidx.appcompat.widget.ListPopupWindow.show(ListPopupWindow.java:663)
at androidx.appcompat.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:181)
at androidx.appcompat.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:208)
at androidx.appcompat.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:290)
at androidx.appcompat.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:177)
at androidx.appcompat.widget.ActionMenuPresenter$OpenOverflowRunnable.run(ActionMenuPresenter.java:792)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:11)
at androidx.test.espresso.base.UiControllerImpl.n(UiControllerImpl.java:6)
at androidx.test.espresso.base.UiControllerImpl.m(UiControllerImpl.java:1)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:6)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:15)
at androidx.test.espresso.action.Tap.b(Unknown Source:9)
at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:1)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:4)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:4)
at androidx.test.espresso.ViewInteraction.a(Unknown Source:137)
at androidx.test.espresso.ViewInteraction$1.call(Unknown Source:4)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:6718)
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)
So as I understand it I am useing APIs that are not listed as "officially supported" in the latest Android and so may be withdrawn at any point.I am struggleing to work out from the JVM backtrace what it the issue in my kotlin code, which APIs, from the above I would guess its AbsListView but I am not using this in my app, can anyone give me any pointers ?
It would appear to be coming from androidx.appcompat.widget.DropDownListView, which is Google's own code. This issue is for Google to fix matters.
There is nothing that you need to do.
I received such log at Google Play Console:
FATAL EXCEPTION: ControllerMessenger
Process: de.jobnetzwerk.jobnet, PID: 31798
kotlin.KotlinNullPointerException
at de.jobnetzwerk.jobnet.notepad.NoteData.getRemarksList(NoteData.kt:282)
at de.jobnetzwerk.jobnet.notepad.NoteData.access$getRemarksList(NoteData.kt:26)
at de.jobnetzwerk.jobnet.notepad.NoteData$updateRemark$1.onResponse(NoteData.kt:121)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:71)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:169)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:161)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:141)
at androidx.test.espresso.action.Tap$1.a(Tap.java:6)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:20)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:79)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:97)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:6718)
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)
below problematic line (num. 282):
Singleton.apiService().getNoteRecords("Bearer " + context!!.getSharedPreferences("app_data", 0)?.getString("access_token", ""), noteID!!).enqueue(object : Callback<List<RemarkModelNotepad>> {
at this line I start getting data from server API. Which part can create a problem?
UPDATE
My problem in generall is connected with safe-types at kotlin. I think that it will be solved by adding ? or !! but I don't kno where I have to add this.