3

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 enter image description here

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?
Jérémy Reynaud
  • 3,020
  • 1
  • 24
  • 36

2 Answers2

2

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.

Jérémy Reynaud
  • 3,020
  • 1
  • 24
  • 36
0

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

Emre Aktürk
  • 3,306
  • 2
  • 18
  • 30
  • I do not use MultiDex and I double-checked my .so files. If there was something in ProGuard config I suppose almost of all users would have the problem. What is weird: a) there is no class name specified, b) it happens of a lot of different devices but mainly on Samsung ones (S3 with 73%, Galaxy Core LTE 10,9%...) - so maybe a bug in the Samsung OS? c) it reminds me this: https://stackoverflow.com/a/10158241/43051. For the second one, thanks for the information, I will check that. – Jérémy Reynaud May 24 '17 at 09:10
  • Can you post your libs folder structure image? – Emre Aktürk May 24 '17 at 09:12
  • I updated my question. Concerning the second issue: ads should be displayed even without Google Play Service installed. It works well on emulator and devices without it. – Jérémy Reynaud May 24 '17 at 09:24
  • Where do you call system load method to init your c libraries? Maybe you should enable multiple dex. – Emre Aktürk May 24 '17 at 09:57
  • The only lib used comes from a third part library: https://github.com/koral--/android-gif-drawable. I don't load it explicitly. – Jérémy Reynaud May 24 '17 at 13:45
  • There is a text for upgrading from 1.1.0 from github of library - You should give it a chance if not tried : It is recommended (but not required) to call LibraryLoader.initialize() before using GifDrawable. Context is needed in some cases when native libraries cannot be extracted normally. See ReLinker for more details. If LibraryLoader.initialize() was not called and normal library loading fails, Context will be tried to be retrieved in fall back way which may not always work. – Emre Aktürk May 24 '17 at 13:55
  • Thanks for your comment, I definitively give it a try in the next release. – Jérémy Reynaud May 24 '17 at 18:13
  • The bug still occurs with theses changes mainly on Samsung devices and Andrdoid 4.x. Found the same issue here: https://stackoverflow.com/questions/44495362/android-classnotfoundexception-crash-report-happening-rarely-after-each-updat – Jérémy Reynaud Jul 02 '17 at 09:01