Search code examples
androidinstabug

Instabug 3 Android Builder crash (NullPointerException)


I recently updated my production Android app from Instabug 2.5.1 to 3.1.1. Since then, I have been getting consistent crash reports on Fabric caused by a NullPointerException in InstabugFeaturesManager for phones ranging from Android 4-6. I haven't seen this issue in testing or been able to reproduce it.

Here is the crash report:

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';
}

Note: I'm excluding those libraries because I want to control what version my app is using.

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

I would argue this is not your normal NullPointerException question. For one, I'm not adding anything to the build that could possibly be null and it crashing internally. Additionally, the Instabug library is heavily obfuscated so I can't make sense of why it is crashing internally. I've looked around everywhere, but haven't found a case of anyone else having this issue. Am I missing something here?


Solution

  • I updated to a new release (3.1.4) the Instabug team pushed out fixing this issue.