Instabug-React-Native: (android) NoClassDefFoundError: com.instabug.library.analytics.AnalyticsObserver

Hey there,

the app crashes whenever I try to launch it because of:

E/AndroidRuntime: FATAL EXCEPTION: main
                  java.lang.NoClassDefFoundError: com.instabug.library.analytics.AnalyticsObserver$1
                      at com.instabug.library.analytics.AnalyticsObserver.<init>(AnalyticsObserver.java:46)
                      at com.instabug.library.analytics.AnalyticsObserver.getInstance(AnalyticsObserver.java:58)
                      at com.instabug.library.Instabug$Builder.setInvocationEvent(Instabug.java:1711)
                      at com.instabug.reactlibrary.RNInstabugReactnativePackage.<init>(RNInstabugReactnativePackage.java:57)
                      at com.instabug.reactlibrary.RNInstabugReactnativePackage.<init>(RNInstabugReactnativePackage.java:69)
                      at com.acuityscheduling.app.android.MainApplication.createAdditionalReactPackages(MainApplication.java:78)
                      at com.reactnativenavigation.react.NavigationReactGateway$ReactNativeHostImpl.getPackages(NavigationReactGateway.java:132)
                      at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:74)
                      at com.reactnativenavigation.react.NavigationReactGateway$ReactNativeHostImpl.createReactInstanceManager(NavigationReactGateway.java:155)
                      at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
                      at com.reactnativenavigation.react.NavigationReactGateway.getReactInstanceManager(NavigationReactGateway.java:59)
                      at com.reactnativenavigation.react.NavigationReactGateway.hasStartedCreatingContext(NavigationReactGateway.java:46)
                      at com.reactnativenavigation.controllers.SplashActivity.onResume(SplashActivity.java:28)
                      at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1184)
                      at android.app.Activity.performResume(Activity.java:5082)
                      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2565)
                      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2603)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2089)
                      at android.app.ActivityThread.access$600(ActivityThread.java:130)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
                      at android.os.Handler.dispatchMessage(Handler.java:99)
                      at android.os.Looper.loop(Looper.java:137)
                      at android.app.ActivityThread.main(ActivityThread.java:4745)
                      at java.lang.reflect.Method.invokeNative(Native Method)
                      at java.lang.reflect.Method.invoke(Method.java:511)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                      at dalvik.system.NativeStart.main(Native Method)

I’m using “instabug-reactnative”: “2.0.11”

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15

Most upvoted comments

Turns out it’s a problem with multiple dex. I forgot to add the following attachBaseContext override code:

public class MyApplication extends SomeOtherApplication {
  @Override
  protected void attachBaseContext(Context base) {
     super.attachBaseContext(context);
     Multidex.install(this);
  }
}

https://developer.android.com/studio/build/multidex.html#mdex-gradle