Ibotta / gradle-aspectj-pipeline-plugin

A Gradle plugin for Android projects which performs AspectJ weaving using Android's bytcode manipulation pipeline.
Apache License 2.0
75 stars 15 forks source link

java.lang.RuntimeException: Unable to instantiate application #6

Closed ForLovelj closed 3 years ago

ForLovelj commented 3 years ago

Have you tested the use of the plugin in Multidex? In Multidex I get this exception.

eschlenz commented 3 years ago

Hey @ForLovelj, do you have the full stacktrace?

To answer your question, yes. We use it in our Ibotta app, which has multidex enabled. If I can see the details of your stacktrace, I may be able to help further assist you.

ForLovelj commented 3 years ago

@eschlenz In the large project Multidex mode, it is possible that Application is not driven into the main dex.

eschlenz commented 3 years ago

@ForLovelj Do you have a sample application you can share that demonstrates the problem? Also, what minimum version of Android are you trying to use this plugin for?

We have not tested this on anything below Android API level 21.

ForLovelj commented 3 years ago

@eschlenz This is the error log,Sorry, I can't share my code, I can't duplicate it on the normal program, it doesn't seem to be easy to solve, now I thinking about using the ASM implementation functionality. java.lang.RuntimeException: Unable to instantiate application com.ai.test.app.App: java.lang.ClassNotFoundException: Didn't find class "com.ai.test.app.App" on path: DexPathList[[zip file "/data/app/~~tx51hTzEHRMrlKWrJa96Fg==/com.ai.test-DXqIAOz-FoDP78QbU4UTAQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~tx51hTzEHRMrlKWrJa96Fg==/com.ai.test-DXqIAOz-FoDP78QbU4UTAQ==/lib/arm64, /data/app/~~tx51hTzEHRMrlKWrJa96Fg==/com.ai.test-DXqIAOz-FoDP78QbU4UTAQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] at android.app.LoadedApk.makeApplication(LoadedApk.java:1248) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6819) at android.app.ActivityThread.access$1400(ActivityThread.java:246) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:7876) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ai.test.app.App" on path: DexPathList[[zip file "/data/app/~~tx51hTzEHRMrlKWrJa96Fg==/com.ai.test-DXqIAOz-FoDP78QbU4UTAQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~tx51hTzEHRMrlKWrJa96Fg==/com.ai.test-DXqIAOz-FoDP78QbU4UTAQ==/lib/arm64, /data/app/~~tx51hTzEHRMrlKWrJa96Fg==/com.ai.test-DXqIAOz-FoDP78QbU4UTAQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:76) at androidx.core.app.CoreComponentFactory.instantiateApplication(CoreComponentFactory.java:52) at android.app.Instrumentation.newApplication(Instrumentation.java:1159) at android.app.LoadedApk.makeApplication(LoadedApk.java:1240) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6819)  at android.app.ActivityThread.access$1400(ActivityThread.java:246)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:236)  at android.app.ActivityThread.main(ActivityThread.java:7876)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) 

eschlenz commented 3 years ago

@ForLovelj Understood. If you find a way to create a sample application that reproduces the problem, please let us know.

eschlenz commented 3 years ago

I'm going to close this issue. I'm sorry we weren't able to help. If you feel this should remain open, let me know.