简体   繁体   English

Google Play开发者控制台上的ClassNotFoundException报告

[英]ClassNotFoundException reports on Google Play Developer Console

I Have some crash reports in my Google Play Console that I can not explain or reproduce. 我的Google Play控制台中有一些崩溃报告,我无法解释或复制。 It seems that it only happens to a very small number of users on multiple devices and Android versions. 似乎只有少数用户在多种设备和Android版本上发生过这种情况。

The Android versions that have reported the crash are. 报告了崩溃的Android版本。 Android 4.4, Android 5.1, Android 6.0. 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. 关于此问题,我总共只有10份报告,但似乎每次我为我的应用发布更新时都会发生。 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. 我大约有40.000个活动的安装,如果这会影响大量用户,我希望看到更多的崩溃报告。

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. 我试图在Stackoverflow上查找其他文章,尽管有一些模拟报告,但大多数报告中都会有一个类名,用于指定引起该问题的是哪个类的引用。 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. 清单中我的应用程序标记中的android:name属性设置为正确的类名,包括完整的包名。 All other classes also seem to be set correctly in the manifest file. 清单文件中似乎也正确设置了所有其他类。

Some stackoverflow post mention multidex settings. 一些stackoverflow帖子提到了multidex设置。 I'm not using that setting in my gradle file. 我不在gradle文件中使用该设置。 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. 我已经检查了我的构建apk文件,以查看有多少方法计数,结果远远低于最大值,因此我看不到需要打开multidex选项。

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. 我在Google Play控制台中报告了相同的异常,但无法在我的设备上重现它。

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. 但是在更新过程中,由于该异常而崩溃,这就是Play控制台的方式。

So check you manifest for wrong services/receivers etc. 因此,请检查您的清单是否有错误的服务/接收器等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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