My Android App reported some crash report:
java.lang.NoSuchMethodError: android.app.ANRAppManager.dumpMessageHistory
at android.app.ActivityThread$ApplicationThread.dumpMessageHistory(ActivityThread.java:1177)
at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java:609)
at android.os.Binder.execTransact(Binder.java:351)
at dalvik.system.NativeStart.run(Native Method)
A lot of android device reported the same crash:
Android|Android=>3
android|Coolpad=>1
Android|Lenovo=>1
Android|VIVO=>2
apsl|Lenovo=>1
apsl|Samsung=>2
ARES|AE912=>3
Coolpad|Coolpad=>2
COWW|C920=>5
GoDonie|GoDonie F7=>1
HESM|HSEM TD777=>2
HMI|H2=>1
huawei|huawei=>2
intki|intki_E86=>3
ioco|i9100 X6=>1
Lenovo|Lenovo A820T=>1
MEEG|MEEG_101M=>2
NEWLAND|N003=>2
SAST|SAST YC500=>1
But I didn't find "dumpMessageHistory" in my code, please help, thanks!!
The class android.app.ANRAppManager can not be found in Android Application Framework (/frameworks/base/core/java/android/app). Probably it is a vendor supplied class for MTK chips. Whenever there is an ANR raised, ANRAppManager.dumpMessageHistory would be invoked.
The best advice would be to keep track of all cases of ANR that takes place in your app and try to fix it.
Related
I create a screenshot application and that work good in all of the android devices.
But I have a problem with take screenshot in android 12 (Xiaomi 11t) I'm using static intent and result code and then clone intent and pass it to this function mediaProjectionManager.getMediaProjection(resultCode,clonedIntent) I have no problem with take screen shot for first time but I can't take screen shot for second time and I get this error.
if you need more info please tell me.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.koala.classor, PID: 10824
java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.Set.add(java.lang.Object)' on a null object reference
at android.os.Parcel.createExceptionOrNull(Parcel.java:2431)
at android.os.Parcel.createException(Parcel.java:2409)
at android.os.Parcel.readException(Parcel.java:2392)
at android.os.Parcel.readException(Parcel.java:2334)
at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:235)
at android.media.projection.MediaProjection.<init>(MediaProjection.java:59)
at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:119)
at com.koala.classor.G.getMediaProjection(G.java:86)
at com.koala.classor.OverScreenWindowService$2$1.run(OverScreenWindowService.java:194)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8105)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.media.projection.MediaProjectionManagerService$MediaProjection.start(MediaProjectionManagerService.java:553)
at android.media.projection.IMediaProjection$Stub.onTransact(IMediaProjection.java:137)
at android.os.Binder.execTransactInternal(Binder.java:1182)
at android.os.Binder.execTransact(Binder.java:1146)
MIUI13+Android12
The RemoteException error is reported on line 553 of MediaProjectionManagerService. After checking the source code, the error message is that the package for applying for mediaprojection cannot be found.
It is guessed that MIUI maintains a separate list for this, only the package that has applied for permission will be in it, and it will be removed after obtaining and closing mediaprojection. No such mechanism has been seen in other systems.
In other words, intent data cannot be reused. The solution is also very simple, just don’t close the mediaprojection after using it.
I have just finished my first android app as part of a school project ..one of my friends encountered a problem while trying to explore one of the activities in the app ..so i searched for solutions to get the crashes reports whenever they happen to fix the bugs ..i came across ACRA ..and I followed one of SO threads to setup ACRA to my app ..
RESULT: when the crashs happens the gmail app get launch in the device and the user (if he want to) he'll send the crash report by email ..Consedering not all users will want to ..i found in a comment in one of the SO threads that some developers use tracepot.
so i have used their link for integration in formUri but exploring my account on tracepot i get nothing ..is there something i am doing wrong (or if there is a better solution than using tracepot a backend , please suggest/explain or link a good tutorial, thanks!)
MyApplication.Java ( AFTER EDITING
#ReportsCrashes(
formUri = "https://collector.tracepot.com/79b1***",
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text
)
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
CaocConfig.Builder.create()
//.errorActivity(CustomErrorActivity.class) //default: null (default error activity)
.apply();
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
}
EDIT :
msg in logcat if i use the http and email:
09-17 18:37:33.700 14329-14812/ma.ac.iav.menunaviagtion:acra W/ACRA: ma.ac.iav.menunaviagtion reports will be sent by email (if accepted by user).
09-17 18:37:33.703 14329-14812/ma.ac.iav.menunaviagtion:acra I/ACRA: Sending report /data/user/0/ma.ac.iav.menunaviagtion/app_ACRA-approved/2018-09-17T18:37:33.441+01:00-IS_SILENT.stacktrace
if i use only the http :
09-17 22:47:00.648 20116-20137/ma.ac.iav.myapplication:acra E/ACRA: Failed to send crash report for /data/user/0/ma.ac.iav.myapplication/app_ACRA-approved/2018-09-17T22:44:52.199+00:00-IS_SILENT.stacktrace
IMPLEMENTATION:
compile 'ch.acra:acra:4.9.2'
LOGCAT FOR F43nd1r
09-18 01:39:49.631 18508-18803/? E/AndroidRuntime: FATAL EXCEPTION: Thread-5
Process: ma.ac.iav.myapplication, PID: 18508
java.lang.InternalError: Thread starting during runtime shutdown
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:733)
at android.app.SharedPreferencesImpl.startLoadFromDisk(SharedPreferencesImpl.java:119)
at android.app.SharedPreferencesImpl.<init>(SharedPreferencesImpl.java:112)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:392)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:373)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.getLastCrashTimestamp(CustomActivityOnCrash.java:673)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.hasCrashedInTheLastSeconds(CustomActivityOnCrash.java:683)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.access$200(CustomActivityOnCrash.java:52)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash$1.uncaughtException(CustomActivityOnCrash.java:112)
at org.acra.builder.ReportExecutor.endApplication(ReportExecutor.java:269)
at org.acra.builder.ReportExecutor.dialogAndEnd(ReportExecutor.java:254)
at org.acra.builder.ReportExecutor.access$400(ReportExecutor.java:42)
at org.acra.builder.ReportExecutor$2.run(ReportExecutor.java:217)
By default, if the mail config is present, Acra 4 will send via mail and nothing else.
To use both you'd have to configure the reportSenderFactories.
400: Client error
Indicates that tracepot rejected your report. This could have multiple reasons. To find out what the problem is, call ACRA.DEV_LOGGING = true; right before ACRA.init and post all logcat with the ACRA tag.
Also note that ACRA 4.9.2 does not support android Oreo and above, it is recommended to upgrade to at least ACRA 4.11, or just the newest version 5.2.0.
You are not sending all required fields to Tracepot.
https://tracepot.uservoice.com/knowledgebase/articles/355272-what-are-the-required-fields-acra-needs-to-send
ANDROID_VERSION
APP_VERSION_CODE
APP_VERSION_NAME
PACKAGE_NAME
REPORT_ID
STACK_TRACE
USER_APP_START_DATE
USER_CRASH_DATE
There is a crash that is showing up repeatedly in Firebase crash reporting for my React Native Android app. However, I am at a loss as to what would be causing it, as the stack trace doesn't cite any of my code. Does anyone know what might be the cause? I am on React Native 0.47.1
The stack trace is as follows:
Exception java.lang.RuntimeException: java.lang.InterruptedException
com.facebook.react.common.futures.SimpleSettableFuture.getOrThrow (SimpleSettableFuture.java:102)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.startNewBackgroundThread (MessageQueueThreadImpl.java:199)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.create (MessageQueueThreadImpl.java:146)
com.facebook.react.bridge.queue.ReactQueueConfigurationImpl.create (ReactQueueConfigurationImpl.java:87)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:101)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:42)
com.facebook.react.bridge.CatalystInstanceImpl$Builder.build (CatalystInstanceImpl.java:574)
com.facebook.react.ReactInstanceManager.createReactContext (ReactInstanceManager.java:999)
com.facebook.react.ReactInstanceManager.access$600 (ReactInstanceManager.java:109)
com.facebook.react.ReactInstanceManager$4.run (ReactInstanceManager.java:802)
java.lang.Thread.run (Thread.java:761)
Caused by java.lang.InterruptedException:
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly (AbstractQueuedSynchronizer.java:1301)
java.util.concurrent.CountDownLatch.await (CountDownLatch.java:203)
com.facebook.react.common.futures.SimpleSettableFuture.get (SimpleSettableFuture.java:66)
com.facebook.react.common.futures.SimpleSettableFuture.getOrThrow (SimpleSettableFuture.java:100)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.startNewBackgroundThread (MessageQueueThreadImpl.java:199)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.create (MessageQueueThreadImpl.java:146)
com.facebook.react.bridge.queue.ReactQueueConfigurationImpl.create (ReactQueueConfigurationImpl.java:87)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:101)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:42)
com.facebook.react.bridge.CatalystInstanceImpl$Builder.build (CatalystInstanceImpl.java:574)
com.facebook.react.ReactInstanceManager.createReactContext (ReactInstanceManager.java:999)
com.facebook.react.ReactInstanceManager.access$600 (ReactInstanceManager.java:109)
com.facebook.react.ReactInstanceManager$4.run (ReactInstanceManager.java:802)
java.lang.Thread.run (Thread.java:761)
This problem also occur for many others as well and the cause is various. You can find the discussion about it here. Since I really don't know what your app does so here is some possible reasons:
You're using react-native-navigation (you can try change it back to react-navigation)
You're using react-native-image-crop-picker or react-native-image-picker (Which produce the same error that make your app crash on some device and it throw InterruptedException
If the problem is number 2 you can try to fix it by alter MainApplication.java:
#Override
public boolean clearHostOnActivityDestroy() {
return false;
}
The fix in number 2 was also reference from here under acintyo answer.
As for changing the react-native version you can try it but I do not recommend it since after reading through the issues mentioned above, I saw that many version also experienced this issues (most of them are 0.49.+ or 0.45.x)
I know some of exceptions are thrown by Android framework. Like ActivityNotFoundException, WindowManager.BadTokenException.
But i am not aware of all other exceptions which are specific to android framework.
Can anybody list possible Android framework specific exceptions with a small description. Or suggest me blogs information which contains the required information.
http://developer.android.com/reference/java/lang/Exception.html
I think here you can find it, "Known Indirect Subclasses", totally 224 exceptions.
Only choose the one started by "Android", here are about 72 exceptions, these should be the list
android.content.ActivityNotFoundException
android.util.AndroidRuntimeException
android.accounts.AuthenticatorException
android.os.BadParcelableException
android.util.Base64DataException
android.hardware.camera2.CameraAccessException
android.database.CursorIndexOutOfBoundsException
android.os.DeadObjectException
android.media.DeniedByServerException
android.support.v4.app.Fragment.InstantiationException
android.opengl.GLException
android.view.InflateException
android.content.IntentFilter.MalformedMimeTypeException
android.content.IntentSender.SendIntentException
android.view.KeyCharacterMap.UnavailableException
android.security.keystore.KeyExpiredException
android.security.keystore.KeyNotYetValidException
android.security.keystore.KeyPermanentlyInvalidatedException
android.util.MalformedJsonException
android.media.MediaCodec.CodecException
android.media.MediaCodec.CryptoException
android.media.MediaDrm.MediaDrmStateException
android.media.MediaDrmResetException
android.accounts.NetworkErrorException
android.os.NetworkOnMainThreadException
android.util.NoSuchPropertyException
android.media.NotProvisionedException
android.support.v4.os.OperationCanceledException
android.content.pm.PackageManager.NameNotFoundException
android.os.ParcelFileDescriptor.FileDescriptorDetachedException
android.os.ParcelFormatException
android.net.ParseException
android.app.PendingIntent.CanceledException
android.support.v8.renderscript.RSDriverException
android.support.v8.renderscript.RSIllegalArgumentException
android.support.v8.renderscript.RSInvalidStateException
android.support.v8.renderscript.RSRuntimeException
android.content.ReceiverCallNotAllowedException
android.os.RemoteException
android.widget.RemoteViews.ActionException
android.media.ResourceBusyException
android.content.res.Resources.NotFoundException
android.database.SQLException
android.database.sqlite.SQLiteAbortException
android.database.sqlite.SQLiteAccessPermException
android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException
android.database.sqlite.SQLiteBlobTooBigException
android.database.sqlite.SQLiteCantOpenDatabaseException
android.database.sqlite.SQLiteConstraintException
android.database.sqlite.SQLiteDatabaseCorruptException
android.database.sqlite.SQLiteDatabaseLockedException
android.database.sqlite.SQLiteDatatypeMismatchException
android.database.sqlite.SQLiteDiskIOException
android.database.sqlite.SQLiteDoneException
android.database.sqlite.SQLiteException
android.database.sqlite.SQLiteFullException
android.database.sqlite.SQLiteMisuseException
android.database.sqlite.SQLiteOutOfMemoryException
android.database.sqlite.SQLiteReadOnlyDatabaseException
android.database.sqlite.SQLiteTableLockedException
android.provider.Settings.SettingNotFoundException
android.database.StaleDataException
android.view.Surface.OutOfResourcesException
android.view.SurfaceHolder.BadSurfaceTypeException
android.nfc.TagLostException
android.util.TimeFormatException
android.os.TransactionTooLargeException
android.media.UnsupportedSchemeException
android.security.keystore.UserNotAuthenticatedException
android.view.WindowManager.BadTokenException
android.view.WindowManager.LayoutParams#token
android.view.WindowManager.InvalidDisplayException
The following are the exceptions that are supported by Android:
1.) InflateException : This exception is thrown When an error conditions are occurred.
2.) Surface.OutOfResourceException: This exception is thrown When a surface is not created or resized.
3.) SurfaceHolder.BadSurfaceTypeException: This exception is thrown from the lockCanvas() method, when invoked on a Surface whose is SURFACE_TYPE_PUSH_BUFFERS
4.) WindowManager.BadTokenException: This exception is thrown at the time of trying to add view an invalid WindowManager.LayoutParamstoken.
I have many reports of this bug. I tried several solutions but till now nothing solved it (see this question). I would like to understand what is going on. Does anybody have a clue about it? I am using v3 of GA.
java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy#4229d028 (pid=12708) when registering receiver android.content.IIntentReceiver$Stub$Proxy#42132728
at android.os.Parcel.readException(Parcel.java:1472)
at android.os.Parcel.readException(Parcel.java:1426)
at android.app.ActivityManagerProxy.registerReceiver(ActivityManagerNative.java:2563)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1677)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1645)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1639)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:486)
at com.google.analytics.tracking.android.GANetworkReceiver.register(SourceFile:52)
at com.google.analytics.tracking.android.GAServiceManager.initializeNetworkReceiver(SourceFile:101)
at com.google.analytics.tracking.android.GAServiceManager.getStore(SourceFile:184)
at com.google.analytics.tracking.android.GAServiceProxy.useStore(SourceFile:315)
at com.google.analytics.tracking.android.GAServiceProxy.connectToService(SourceFile:333)
at com.google.analytics.tracking.android.GAServiceProxy.access$600(SourceFile:28)
at com.google.analytics.tracking.android.GAServiceProxy$ReconnectTask.run(SourceFile:415)
at java.util.Timer$TimerImpl.run(Timer.java:284)
Another trace:
java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy#42ac1ee8 (pid=21543) when registering receiver android.content.IIntentReceiver$Stub$Proxy#42abb9d0
at android.os.Parcel.readException(Parcel.java:1465)
at android.os.Parcel.readException(Parcel.java:1419)
at android.app.ActivityManagerProxy.registerReceiver(ActivityManagerNative.java:2363)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1571)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1539)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1533)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:467)
at com.google.analytics.tracking.android.GANetworkReceiver.register(SourceFile:52)
at com.google.analytics.tracking.android.GAServiceManager.initializeNetworkReceiver(SourceFile:101)
at com.google.analytics.tracking.android.GAServiceManager.getStore(SourceFile:184)
at com.google.analytics.tracking.android.GAServiceProxy.useStore(SourceFile:315)
at com.google.analytics.tracking.android.GAServiceProxy.connectToService(SourceFile:333)
at com.google.analytics.tracking.android.GAServiceProxy.access$600(SourceFile:28)
at com.google.analytics.tracking.android.GAServiceProxy$ReconnectTask.run(SourceFile:415)
at java.util.Timer$TimerImpl.run(Timer.java:284)