简体   繁体   中英

ClassNotFoundException reports on Google Play Developer Console

I Have some crash reports in my Google Play Console that I can not explain or reproduce. It seems that it only happens to a very small number of users on multiple devices and Android versions.

The Android versions that have reported the crash are. Android 4.4, Android 5.1, Android 6.0.

I Only have a total of 10 reports on this issue but it does seem to happen every time I publish an update for my app. The app works fine on my devices and multiple emulators as well as for most of my users. I Have about 40.000 active installations, if it would affect a large number of users I would expect to see much more crash reports.

I've tried to look up other posts here on Stackoverflow and while there are some simular reports most of them would have a class name in the report specifying which reference to which class was causing the issue. In my case as you can see in the report the classname is empty.

The android:name attribute in my application tag in my manifest is set to the correct classname including the full package name. All other classes also seem to be set correctly in the manifest file.

Some stackoverflow post mention multidex settings. I'm not using that setting in my gradle file. I've done an inspection of my build apk file to see how many method counts there were and the result was way below the maximum, so I don't see any need to turn on the multidex option.

I'm a bit out of ideas what can be the cause of this issue, but if it's possible I would like to fix it. Even if it's only a small number of people affected by this, that is still some people that might have a bad experience with my app because of it.

java.lang.RuntimeException: 
  at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4539)
  at android.app.ActivityThread.access$1500(ActivityThread.java:164)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1318)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:157)
  at android.app.ActivityThread.main(ActivityThread.java:5350)
  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:1265)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
  at dalvik.system.NativeStart.main(NativeStart.java:0)
Caused by: java.lang.ClassNotFoundException: 
  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
  at android.app.Instrumentation.newApplication(Instrumentation.java:993)
  at android.app.LoadedApk.makeApplication(LoadedApk.java:511)

Posting this answer just in case someone is having the same issue as me. I had the same exception reported in Google Play console and wasn't able to reproduce it on my device.

My app was using library project that had service and boot receiver that were mentioned in the app's manifest. But those were removed in the library. Build didn't fail and the app was working as expected from users point of view. But during update it was crashing with this exception and this is how it got to Play console.

So check you manifest for wrong services/receivers etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM