I am playing music in backgroud. After I get "AndroidRuntime: Shutting down VM" then my app crashes. It suddenly stop playin music.
I am getting this error from devices have android 11 or android 10.
val mediaSessionCompat = MediaSessionCompat(context, "NotificationActionService") //CreateNotification.kt:32
Log:
2021-01-12 14:49:56.655 12908-12908/com.dev.test5 D/AndroidRuntime: Shutting down VM
--------- beginning of crash
2021-01-12 14:49:56.658 12908-12908/com.dev.test5 E/AndroidRuntime: FATAL EXCEPTION: main
Process: , PID: 12908
java.lang.NullPointerException: Attempt to invoke interface method 'android.media.session.ISessionController android.media.session.ISession.getController()' on a null object reference
at android.media.session.MediaSession.<init>(MediaSession.java:199)
at android.media.session.MediaSession.<init>(MediaSession.java:156)
at android.support.v4.media.session.MediaSessionCompatApi21.createSession(MediaSessionCompatApi21.java:46)
at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi21.<init>(MediaSessionCompat.java:3380)
at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi28.<init>(MediaSessionCompat.java:3906)
at android.support.v4.media.session.MediaSessionCompat.<init>(MediaSessionCompat.java:493)
at android.support.v4.media.session.MediaSessionCompat.<init>(MediaSessionCompat.java:456)
at android.support.v4.media.session.MediaSessionCompat.<init>(MediaSessionCompat.java:430)
at com.dev.test5.aui.base.fragment.exercise.listening.notification.CreateNotification.createNotification(CreateNotification.kt:32)
at com.dev.test5.aui.base.fragment.exercise.listening.ListeningExerciseActivity.setVariables(ListeningExerciseActivity.kt:464)
at com.dev.test5.aui.base.fragment.exercise.listening.ListeningExerciseActivity.run(ListeningExerciseActivity.kt:495)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7476)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:939)
There is an internal Android MediaSessions limit SESSION_CREATION_LIMIT_PER_UID = 100;
You should release MediaSession instances that you don't need anymore.
See my answer here
Related
firebase crash logs one.
Fatal Exception: java.lang.IllegalStateException: CameraDevice was already closed
at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2236)
at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureSessionInternal(CameraDeviceImpl.java:658)
at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureSession(CameraDeviceImpl.java:644)
at io.flutter.plugins.camera.Camera$DefaultCameraDeviceWrapper.createCaptureSession(Camera.java:175)
at io.flutter.plugins.camera.Camera.createCaptureSessionWithSessionConfig(Camera.java:479)
at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:465)
at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:387)
at io.flutter.plugins.camera.Camera.startPreview(Camera.java:1074)
at io.flutter.plugins.camera.Camera$1.onOpened(Camera.java:322)
at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
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.os.HandlerThread.run(HandlerThread.java:67)
firebase crash logs two.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.camera2.CameraCaptureSession.close()' on a null object reference
at io.flutter.plugins.camera.Camera.closeCaptureSession(Camera.java:1192)
at io.flutter.plugins.camera.Camera.access$500(Camera.java:100)
at io.flutter.plugins.camera.Camera$1.onClosed(Camera.java:342)
at android.hardware.camera2.impl.CameraDeviceImpl$5.run(CameraDeviceImpl.java:255)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.os.HandlerThread.run(HandlerThread.java:67)
two crashes caught in my firebase account.
by investigations, It happened at the camera plugin used in flutter modules,
It's happening on android devices only, versions are 9 to 12 versions.
Used plugin details:
camera: ^0.10.0
https://pub.dev/packages/camera
any one can help with this, ?
I updated Android Studio till 4.1.1, i updated everything for launching emulator AVD on API 30,
but i get "No tests were found" when i'm trying to launch my UI-tests (Espresso framework) on that emulator.
In the same time i have no any problems with emulator 29 or below.
--------- beginning of crash
2020-11-24 18:04:31.036 24852-24852 E/AndroidRuntime: FATAL EXCEPTION: main
PID: 24852
java.lang.IllegalArgumentException: Wrong number of arguments; expected 6, got 3
at java.lang.reflect.Method.invoke(Native Method)
at androidx.test.services.speakeasy.client.ToolConnection$ToolConnectionPostIcs.doCall(ToolConnection.java:197)
at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:79)
at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:69)
at androidx.test.services.shellexecutor.BlockingPublish.getResult(BlockingPublish.java:74)
at androidx.test.services.shellexecutor.ShellCommandExecutorServer.start(ShellCommandExecutorServer.java:80)
at androidx.test.services.shellexecutor.ShellMain.main(ShellMain.java:45)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
2020-11-24 18:04:31.036 24852-24852 E/AndroidRuntime: Error reporting crash
java.lang.RuntimeException: Bad file descriptor
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(BinderProxy.java:540)
at android.app.IActivityManager$Stub$Proxy.handleApplicationCrash(IActivityManager.java:5182)
at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:158)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
2020-11-24 18:04:31.036 24852-24852 I/Process: Sending signal. PID: 24852 SIG: 9
Does anybody know what's the problem?
Thank a lot!
You should add permission WAKE_LOCK and increase androidx test orchestrator version. Also you should check actual versions for espresso core, rules and test runner.
I am developing android app using camera2 api. I am getting following crash sometimes for some reason.
E/AndroidRuntime: FATAL EXCEPTION: LegacyCameraCallback
Process: com.vuro, PID: 5793
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List android.hardware.camera2.params.OutputConfiguration.getSurfaces()' on a null object reference
at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureErrorLocked(CameraDeviceImpl.java:2276)
at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onDeviceError(CameraDeviceImpl.java:1914)
at android.hardware.camera2.legacy.CameraDeviceUserShim$CameraCallbackThread$CallbackHandler.handleMessage(CameraDeviceUserShim.java:308)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
E/AWSKeyValueStore: com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
I/AWSKeyValueStore: Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
I/tensorflow: MultiBoxTracker: Processing 0 results from 22
I/Process: Sending signal. PID: 5793 SIG: 9
If anyone has experience in this crash, Please help me.
Thank you.
While launching the application on emulator the following exception is occurred. But running on device it is working fine. Please help to get rid of the issue.
have been facing the issue around five days. cannot get any proper solution.
2018-10-13 07:45:15.423 1742-1756/system_process E/ActivityManager: Activity Manager Crash. UID:1000 PID:1742 TRANS:5
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)' on a null object reference
at android.app.LoadedApk.createAppFactory(LoadedApk.java:224)
at android.app.LoadedApk.<init>(LoadedApk.java:152)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2043)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1998)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1970)
at android.app.ContextImpl.createPackageContextAsUser(ContextImpl.java:2054)
at com.android.server.AttributeCache.get(AttributeCache.java:135)
at com.android.server.am.ActivityRecord.<init>(ActivityRecord.java:903)
at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:804)
at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:528)
at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:1057)
at com.android.server.am.ActivityStarter.execute(ActivityStarter.java:473)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4841)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4817)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:146)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3114)
at android.os.Binder.execTransact(Binder.java:726)
2018-10-13 07:45:15.424 9564-9564/com.google.android.apps.nexuslauncher D/AndroidRuntime: Shutting down VM
--------- beginning of crash
2018-10-13 07:45:15.425 9564-9564/com.google.android.apps.nexuslauncher E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.apps.nexuslauncher, PID: 9564
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)' on a null object reference
at android.os.Parcel.createException(Parcel.java:1948)
at android.os.Parcel.readException(Parcel.java:1865)
at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4541)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1660)
at android.app.Activity.startActivityForResult(Activity.java:4574)
at com.android.launcher3.Launcher.startActivityForResult(SourceFile:1394)
at android.app.Activity.startActivity(Activity.java:4889)
at com.android.launcher3.Launcher.startActivitySafely(SourceFile:2000)
at com.android.launcher3.Launcher.startAppShortcutOrInfoActivity(SourceFile:1850)
at com.android.launcher3.Launcher.onClick(SourceFile:1703)
at android.view.View.performClick(View.java:6579)
at android.view.View.performClickInternal(View.java:6556)
at android.view.View.access$3100(View.java:777)
at android.view.View$PerformClick.run(View.java:25660)
at android.os.Handler.handleCallback(Handler.java:819)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: android.os.RemoteException: Remote stack trace:
at android.app.LoadedApk.createAppFactory(LoadedApk.java:224)
at android.app.LoadedApk.<init>(LoadedApk.java:152)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2043)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1998)
at android.app.ActivityThread.getPackageInfo(ActivityThread.java:1970)
Hey i'm creating android app which using worklight native api but i'm getting this Exception when there is connection error and i don't know how to handle it
at com.worklight.location.internal.events.EventTransmitterPiggybacker.onFailure(EventTransmitterPiggybacker.java:68)
09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca E/AndroidRuntime: at com.worklight.wlclient.WLRequest.processFailureResponse(WLRequest.java:597)
09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca E/AndroidRuntime: at com.worklight.wlclient.WLRequest.requestFinished(WLRequest.java:194)
09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca E/AndroidRuntime: at com.worklight.wlclient.InternalRequestSender.run(AsynchronousRequestSender.java:138)
09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-21 14:09:44.472 20167-20285/cloudappers.com.rta_ca E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
I have found that this exception is a timeout exception
so i solved this issue by increasing the timeout
WLRequestOptions options = new WLRequestOptions();
options.setTimeout(60000);
i know this is not the solution which will solve the exception permanently but at least it never happens again