Application类中的java.lang.VerifyError,用于一小部分用户

mar*_*mor 7 crash android verifyerror android-application-class

(这不是其他类似问题的重复,因为这只发生在一小部分用户身上,不能由我重新创建)

在我最新的发布版本中,我突然看到了班级中java.lang.VerifyError出现类似崩溃的巨大高峰Application.

这条线很简单:

Settings.init(this);
Run Code Online (Sandbox Code Playgroud)

Settings周围的便利包装类在哪里SharedPreferences.似乎在不到百分之一的用户中找不到该类.

我们无法在我的团队设备上重新创建崩溃,Google Play的发布前报告显示0错误.

这是完整的堆栈跟踪:

java.lang.VerifyError: 
at com.my_package.MyApplication.onCreate (MyApplication.java:74)
at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1036)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6321)
at android.app.ActivityThread.access$1800 (ActivityThread.java:222)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1861)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:158)
at android.app.ActivityThread.main (ActivityThread.java:7229)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
Run Code Online (Sandbox Code Playgroud)

Settings.init:

public static void init(Context context) {
    sPrefs = PreferenceManager.getDefaultSharedPreferences(context);
}
Run Code Online (Sandbox Code Playgroud)

我应该补充一点,这个问题在我的单个生产应用程序版本上发生了97%,我无法重新创建运行该版本或任何版本的崩溃,但似乎只有该版本受到影响,到目前为止所有版本都有没有这个崩溃.

但是,我仍然看到该应用版本在Google Play中崩溃,我担心它可能会在未来的版本中出现,因为我认为我在这个版本中没有改变任何方式与堆栈跟踪相关.

我得到的这次崩溃的统计数据

小智 0

这是一个艺术代码错误,这意味着找不到某个类,对于一小部分用户 ,您可以在 Application 类中看到此 java.lang.VerifyError ,这个问题听起来像是正确的解决方案。