Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instabug fails to initialize, throwing ClassNotFoundException #91

Closed
joharei opened this issue Apr 18, 2018 · 26 comments
Closed

Instabug fails to initialize, throwing ClassNotFoundException #91

joharei opened this issue Apr 18, 2018 · 26 comments
Assignees

Comments

@joharei
Copy link

joharei commented Apr 18, 2018

Instabug stopped working for us in version 4.5.0. 4.3.3 is working, but versions 4.5.0-4.13.1 are not. This stacktrace is repeated for lots of Instabug classes:

04-18 17:01:20.424 1948-1948/no.ruter.reise.labs.debug W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754)
    		... 8 more
java.lang.ClassNotFoundException: com.instabug.bug.InstabugBugReporting
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:453)
        at java.lang.Class.forName(Class.java:378)
        at com.instabug.library.c.a.c(InstabugBugReporting.java:286)
        at com.instabug.library.c.a.b(InstabugBugReporting.java:130)
        at com.instabug.library.Instabug$Builder.build(Instabug.java:2561)
        at com.instabug.library.Instabug$Builder.build(Instabug.java:2617)
04-18 17:01:20.425 1948-1948/no.ruter.reise.labs.debug W/System.err:     at no.ruter.reise.util.InstabugUtils.setUpInstabug(InstabugUtils.java:21)
        at no.ruter.reise.MainApplication.onCreate(MainApplication.kt:53)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5874)
        at android.app.ActivityThread.access$1100(ActivityThread.java:193)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1623)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.instabug.bug.InstabugBugReporting" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/base.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_dependencies_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_resources_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_0_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_1_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_2_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_3_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_4_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_5_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_6_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_7_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_8_apk.apk", zip file "/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/lib/arm64, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    	... 19 more
    	Suppressed: java.io.IOException: No original dex files found for dex location /data/app/no.ruter.reise.labs.debug-POoCZOXNj5I3QGuFs40rag==/split_lib_resources_apk.apk
        at dalvik.system.DexFile.openDexFileNative(Native Method)
        at dalvik.system.DexFile.openDexFile(DexFile.java:356)
        at dalvik.system.DexFile.<init>(DexFile.java:103)
        at dalvik.system.DexFile.<init>(DexFile.java:77)
        at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
        at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
        at dalvik.system.DexPathList.<init>(DexPathList.java:157)
        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
        at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
04-18 17:01:20.426 1948-1948/no.ruter.reise.labs.debug W/System.err:     at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
        at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:72)
        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:38)
        at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:713)
        at android.app.LoadedApk.getClassLoader(LoadedApk.java:747)
        at android.app.LoadedApk.getResources(LoadedApk.java:969)
        at android.app.ContextImpl.createAppContext(ContextImpl.java:2298)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754)
    		... 8 more

Instabug is set up like this:

new Instabug.Builder(application, "(...)")
                .setInvocationEvent(InstabugInvocationEvent.SCREENSHOT_GESTURE)
                .setCrashReportingState(Feature.State.DISABLED)
                .setSurveysState(Feature.State.DISABLED)
                .setReproStepsState(State.DISABLED)
                .build();

Please tell me if I can provide more information.

@Korazy
Copy link

Korazy commented Apr 18, 2018

Hey @joharei,

Thanks for all the details, we'll definitely look into this and get back to you as soon as possible!

@Korazy Korazy self-assigned this Apr 18, 2018
@Korazy
Copy link

Korazy commented Apr 18, 2018

@joharei Can you please enable MultiDex, that should solve the issue. If it's already enabled and not working, is your main Application class extending MultiDexApplication?

@joharei
Copy link
Author

joharei commented Apr 18, 2018

Hi @Korazy,
Thanks for the quick reply. I have enabled MultiDex, and have tried both extending MultiDexApplication and overriding attachBaseContext() and using MultiDex.install(), even though my minSdkVersion is 21. None of that helps unfortunately.

@Korazy
Copy link

Korazy commented Apr 18, 2018

@joharei I see, let us look into this again and get back to you.

@Korazy
Copy link

Korazy commented Apr 20, 2018

@joharei can you please tell me if you have any permissions in your AndroidManifest.xml?

@joharei
Copy link
Author

joharei commented Apr 20, 2018

These are our permissions:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.VIBRATE" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <uses-permission-sdk-23 android:name="android.permission.READ_CALENDAR" />
    <uses-permission-sdk-23 android:name="android.permission.WRITE_CALENDAR" />

@Korazy
Copy link

Korazy commented Apr 23, 2018

@joharei apologies for the delay. Can you please update your support libraries to be exactly like the version added in instabug which is 27.0.2, then clean the project and rebuild again?

@joharei
Copy link
Author

joharei commented Apr 26, 2018

Hi, We were using 27.1.1, but I've now tried 27.0.2, and the problem persists.

@Korazy
Copy link

Korazy commented Apr 26, 2018

@joharei Have you tried cleaning the project or perhaps using ./gradlew --refresh-dependencies?

@joharei
Copy link
Author

joharei commented Apr 26, 2018

Yes, I've tried both, and "Invalidate Caches / Restart".

@joharei
Copy link
Author

joharei commented Apr 26, 2018

So what was changed from version 4.3.3 to 4.5.0 that could be related to this?

@Korazy
Copy link

Korazy commented Apr 26, 2018

@joharei Currently, we're investigating to find out the reason for this issue. Apologies for the hassle!

@Korazy
Copy link

Korazy commented Apr 27, 2018

can you please send us your app level build.gradle file and your project level build.gradle file as well?

@oleandre
Copy link

Hello @Korazy. I've taken over Johan's place in the project. I've added the build files as a zip-file. Let me know if you need any additional information.

gradlebuildfiles.zip

@Korazy
Copy link

Korazy commented May 2, 2018

@oleandre Thank you! We'll take a look at them and get back to you.

@Korazy
Copy link

Korazy commented May 4, 2018

@oleandre can you please try adding
implementation 'com.android.support:multidex:1.0.3'
to your dependencies and try a clean build?

@oleandre
Copy link

oleandre commented May 7, 2018

Doesn't seem to work. I can supply with my code for setting up Instabug:

`public static void setUpInstabug(Application application) {
new Instabug.Builder(application, "a19cde8785b650d6ae788aeb9fad45e5")
.setInvocationEvent(InstabugInvocationEvent.FLOATING_BUTTON)
.setCrashReportingState(Feature.State.DISABLED)
.setSurveysState(Feature.State.DISABLED)
.setReproStepsState(State.DISABLED)
.build();
Instabug.setTheme(InstabugColorTheme.InstabugColorThemeDark);
}

public static OkHttpClient.Builder addLoggingInterceptor(OkHttpClient.Builder builder) {
    return builder.addInterceptor(new InstabugOkhttpInterceptor());
}`

I've tried both Floating Button and Screenshot Gesture as invocation events.

@oleandre
Copy link

Any news on this @Korazy ?

@Korazy
Copy link

Korazy commented May 14, 2018

@oleandre we tried all we could to reproduce the issue but we were unable to, would you be able to send us a sample project with the issue?

@kamelnabil kamelnabil assigned Korazy and unassigned Korazy May 23, 2018
@Korazy
Copy link

Korazy commented May 28, 2018

Hey @oleandre

Would you be able to send us a sample project?

@oleandre
Copy link

Hey @Korazy
I have to wait until next time we decide to release a new beta before creating an example, too much other stuff to do right now. THank you for the heads up and I will contact you, probably closer to end of June.

@Korazy
Copy link

Korazy commented Jul 4, 2018

Hey @oleandre

I hope you're well. I just wanted to check if this issue is still ongoing with the latest release of 8.0.0?

@oleandre
Copy link

oleandre commented Jul 4, 2018

Hi @Korazy!

We're in a major rewrite of our application, and we'll be releasing a beta in a month or two. I haven't looked anymore at it because of other priorities, but I will ping you when I have analyzed the problem again. Thank you so much for the follow-up, and have a great day! :-)

@Korazy
Copy link

Korazy commented Jul 4, 2018

@oleandre It's no worries at all. I hope everything works out great for you with the rewrite!

Have a lovely day :)

@oleandre
Copy link

oleandre commented Aug 8, 2018

@Korazy Hi. I tried to use Instabug again today and incremented the version code to 8.0.3(that's the last version right?). The first time I open the application(after installation) I get the message from Instabug that I can trigger by shaking phone, but I'm not able to trigger it. Any more tips and do I have the correct version code?

@oleandre
Copy link

oleandre commented Aug 9, 2018

@Korazy I added the 'com.instabug.library:instabug:8+' in addition to 'com.instabug.library:instabug-with-okhttp-interceptor:8+' which I had before, and now it's working! You can close the issue :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants