我最近将我的生产 Android 应用程序从 Instabug 2.5.1 更新到了 3.1.1。从那时起,我一直在收到有关 Fabric 的一致崩溃报告,该报告是由 InstabugFeaturesManager 中的 NullPointerException 引起的,适用于 Android 4-6 的手机。我在测试中没有看到这个问题,也没有能够重现它。
这是崩溃报告:
Fatal Exception: java.lang.RuntimeException: Unable to create application com.myapp.main.MyApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6032)
at android.app.ActivityThread.access$1700(ActivityThread.java:218)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at com.instabug.library.h.a(InstabugFeaturesManager.java:70)
at com.instabug.library.g.b(InstabugDelegate.java:208)
at com.instabug.library.Instabug$Builder.build(Instabug.java:1277)
at com.instabug.library.Instabug$Builder.build(Instabug.java:1372)
at com.myapp.main.MyApplication.onCreate(MyApplication.java:107)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1035)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6029)
at android.app.ActivityThread.access$1700(ActivityThread.java:218)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
build.gradle
:
compile('com.instabug.library:instabug:3.1.1') {
exclude group: 'com.android.support';
exclude group: 'com.google.android.gms';
}
注意:我排除了这些库,因为我想控制我的应用程序使用的版本。
MyApplication#onCreate()
:
new Instabug.Builder(this, MyConstants.Application.INSTABUG_KEY)
.setInvocationEvent(InstabugInvocationEvent.SHAKE)
.setShakingThreshold(500)
.setCrashReportingState(Feature.State.DISABLED)
.setTrackingUserStepsState(Feature.State.ENABLED)
.setInAppMessagingState(Feature.State.DISABLED)
.setIntroMessageEnabled(false)
.setEmailFieldRequired(true)
.build(); //Crash originates here
我认为这不是您的正常NullPointerException
问题。一方面,我没有在构建中添加任何可能为空且内部崩溃的内容。此外,Instabug 库被严重混淆,所以我无法理解它为什么会在内部崩溃。我四处张望,但没有发现其他人有这个问题的案例。我在这里错过了什么吗?