I noticed a huge difference in the number of crashes reported by Crashlytics (Fabric) and Google Play Developer Console. Also we are using Firebase, it also shows a number similar to Crashlytics. However, there is a huge difference in developer console.
This led me to investigate all the crash report details one by one. Then I found a specific crash which happened many many times. This crash is reported only in developer console. However, it does not exist in Crashlytics and Firebase. Developer console provides a short stacktrace of the exception. Here it is.
java.lang.RuntimeException:
at android.app.ActivityThread.installProvider(ActivityThread.java:5196)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4799)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4683)
at android.app.ActivityThread.access$1400(ActivityThread.java:168)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1389)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5493)
at java.lang.reflect.Method.invokeNative(Native Method:0)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
at dalvik.system.NativeStart.main(Native Method:0)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.ActivityThread.installProvider(ActivityThread.java:5181)
As you can see, it doesn't tell me which class is not found in the stacktrace. So my hands are tied a little bit here.
Might this crash be happening before the singleton application class is instantiated? Might be happening before Crashlytics and Firebase instances are created?
By the way, this exception is happening only in Android 4.2, 4.3 and 4.4 according to the developer console reports.
Anybody ever experienced this issue, or any ideas? Thanks in advance.
Related
The ANRs & crashes section of the Google Play Console has been recently updated to display more ANRs & crashes (automatically collected from users that have opted in).
I found a lot of strange new crashes, on various Android versions and devices:
1) The most common (thousands of occurrences a week), a ClassNotFoundException without any class name:
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4657)
at android.app.ActivityThread.access$1400(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Method.java:0)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(NativeStart.java:0)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newApplication(Instrumentation.java:992)
at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
2) The most common (hundreds), a RuntimeException that seems related to admob (com.google.android.gms.ads.internal.*):
java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2429)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Method.java:0)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
at dalvik.system.NativeStart.main(NativeStart.java:0)
Caused by: java.lang.IllegalStateException:
at com.google.android.gms.ads.internal.zzj.a(zzj.java:322)
at com.google.android.gms.ads.internal.client.ak.onTransact(ak.java:98)
at android.os.Binder.transact(Binder.java:361)
at com.google.android.gms.internal.zzet$zza$zza.zza(zzet.java:0)
at <OR>.zza(zzet.java:0)
at <OR>.zza(zzet.java:0)
...
at <OR>.zza(zzet.java:0)
...
Notes:
the stack trace is very long and contains a lot of methods with , line number is always 0
the app uses Proguard
lib folder architecture
3) a bunch of other exceptions with same kind of traces (a lot of methods with and line number 0)
My questions are:
Do you experience similar reports?
Are these reports really relevant? I mean, I should receive more direct user feedbacks. Is it possible, they are "silent" crashes?
Are there any know issues / fixes?
I managed to decrease occurrences of it by adding these lines to my Proguard file:
-keep class android.app.Application
-keep class <<MyPackage>>.MyApplication
that may be shortened to:
-keep class * extends android.app.Application
According to android source code I suppose it fixed the first issue.
I also updated all my libs to the last versions (Google Play Services 11.0.2, support lib 25.4.0) that should have fixed the second one.
UPDATE: it doesn't fix the issue completely. I got far less occurrences but there are still some.
First bug look like there is a problem with multiple dex. Make sure you have correct implementation for it. Or if you have .so files in libs folder also make sure they covers all cpu architectures. If still occurs check your proguard file
Second bug is all about Google play service versions. Your app requires higher play service version and device doesn't have this. It's needed to be updated or make sure it's have play services also. You can search web about Google Play Service Availability for more info.
Good luck
Emre
Background
My app has a small PlusOne button in it (using Google-Play-Services rev. 21.0.2) , and recently I got the next crash report from one of the users
java.lang.NoClassDefFoundError: android.os.AsyncTask
at com.google.android.gms.plus.data.internal.PlusImageView.a(SourceFile:60)
at com.google.android.gms.plus.internal.bw.a(SourceFile:917)
at com.google.android.gms.common.internal.v.d(SourceFile:200)
at com.google.android.gms.common.internal.u.handleMessage(SourceFile:136)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3770)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
at dalvik.system.NativeStart.main(Native Method)
The problem
I've followed all of the instructions of the Play Services for a very long time (including the Proguard part), and never had this issue before.
The weird thing is that I've succeeded running the app on multiple devices without any issue, and there are quite a lot of users out there that use my app . Many also uninstall, but this is the first time I get this crash.
The question
I'm not a Proguard expert, but is it maybe possible that this is the reason for it?
What could be the reason for this issue?
How can I fix this issue?
I've tried to search for this problem and there isn't even a single website that I've found regarding it.
I published an Android application that uses ACRA for crash reporting. Now I got a strange crash report:
java.lang.NullPointerException
at android.webkit.WebViewClassic.setBaseLayer(WebViewClassic.java:5377)
at android.webkit.WebViewClassic.setNewPicture(WebViewClassic.java:10781)
at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:10012)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
The report was sent from a Samsung Galaxy S3 (GT-I9300) running Android 4.1.1. The report is strange (from my point of view) because my app doesn't use a WebView (no display of web pages in the whole app, no HTML handling at all). Furthermore the stack trace doesn't include any of my packages. Certainly I cannot reproduce the crash.
Has anybody else encountered this (or a very similar) stack trace? Why is this exception thrown? And what can I do to avoid the exception? Any help is really appreciated.
This can be caused due to use of external ad networks that may use WebViews. This is a problem that needs to be addressed by the ad network maintainers. Apart from bringing it their attention, there is really nothing you can do about this short of removing the offending providers' ads from your application.
We recently introduced OAuth login in our app. This means using a WebView to authenticate the user, and an AsyncTask to do necessary REST calls afterwards.
Unfortunately, after introducing this login method, we're getting reports of the app force closing. This seems to be related to other AsyncTasks that are executed after the login, but the stack traces does unfortunately not tell us much:
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3100)
at android.view.View.performClick(View.java:3627)
at android.view.View$PerformClick.run(View.java:14329)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4511)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3095)
... 11 more
Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask
at com.foo.bar.TransmissionActivity.transmit(TransmissionActivity.java:44)
... 14 more
We managed to fix the error above by using RoboAsyncTask (from RoboGuice), instead of AsyncTask from the Android SDK, but we have other activities that use WebViews. WebView apparently uses AsyncTask somewhere in its call stack, and errors similar the one shown above (Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask) have started to show in our error logs.
The error happens on different devices, and different Android versions, with no apparent pattern. We have tried to reproduce the error ourselves, without any luck.
Any ideas?
It might be an issue with the build setup. (Build order of src/gen has been known to cause some issues, the libs folder for the compat library being called lib has caused some issues for me on new sdk versions).
To see if it is create a new project (in eclipse, since that's 100% android official). Add a webview and an asynctask and then do a diff on the project with your project. Ignoring src/gen/res. Hopefully you'll find that the src/gen are built in the wrong order or something like that.
~ Anders
I have an android app on Google Play and occasionally get the following error reported through the developer console / ACRA. The app runs fine on my test devices and on the various AVDs that I test it on.
The stack trace doesn't state where in the app the problem is. Is there anything I can do to narrow down where to look? What generally causes the error?
java.lang.IndexOutOfBoundsException
at android.graphics.Paint.native_measureText(Native Method)
at android.graphics.Paint.measureText(Paint.java:1020)
at android.graphics.Paint.measureText(Paint.java:1057)
at android.text.Styled.drawDirectionalRun(Styled.java:267)
at android.text.Styled.measureText(Styled.java:430)
at android.text.Layout.measureText(Layout.java:1518)
at android.text.Layout.getHorizontal(Layout.java:564)
at android.text.Layout.getHorizontal(Layout.java:548)
at android.text.Layout.getPrimaryHorizontal(Layout.java:533)
at android.widget.TextView$QuickAction.getBound(TextView.java:9550)
at android.widget.TextView$QuickAction.show(TextView.java:9604)
at android.widget.TextView$QuickActionController.show(TextView.java:8846)
at android.widget.TextView.performLongClick(TextView.java:8033)
at android.view.View$CheckForLongPress.run(View.java:9096)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller
.run(ZygoteInit.java:895)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653)
at dalvik.system.NativeStart.main(Native Method)
From the look of this, you have a race in your application initialization block. Probably one of your text resources is not fully inflated before a draw is issued. (i know, the model of the android runtime should prevent this, but if this happens when the layout is calculated, it would be plausible).
Hope this is of some help in narrowing it down.