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

Issue w/ leakcanary w/ androidTest #397

Open
herriojr opened this issue Sep 1, 2022 · 0 comments
Open

Issue w/ leakcanary w/ androidTest #397

herriojr opened this issue Sep 1, 2022 · 0 comments

Comments

@herriojr
Copy link

herriojr commented Sep 1, 2022

Describe the issue
For some reason just doing the following in the module:

plugins {
    ...
    id 'com.kezong.fat-aar'
}

Causes a silent pass the androidTests by not running any tests:

> Task :MyApp:connectedDebugAndroidTest
Starting 0 tests on Pixel_XL_API_31(AVD) - 12

If you look further into it, you can see that it appears to have somehow screwed up the R file:

09-01 15:50:03.374 14346 14346 E AndroidRuntime: FATAL EXCEPTION: main
09-01 15:50:03.374 14346 14346 E AndroidRuntime: Process: my.app.test, PID: 14346
09-01 15:50:03.374 14346 14346 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/leakcanary/core/R$bool;
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at leakcanary.internal.InternalLeakCanary.addDynamicShortcut(InternalLeakCanary.kt:208)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at leakcanary.internal.InternalLeakCanary.invoke(InternalLeakCanary.kt:148)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at leakcanary.internal.InternalLeakCanary.invoke(InternalLeakCanary.kt:40)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at leakcanary.AppWatcher.manualInstall(AppWatcher.kt:110)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at leakcanary.AppWatcher.manualInstall$default(AppWatcher.kt:94)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at leakcanary.internal.MainProcessAppWatcherInstaller.onCreate(MainProcessAppWatcherInstaller.kt:21)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.content.ContentProvider.attachInfo(ContentProvider.java:2404)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.content.ContentProvider.attachInfo(ContentProvider.java:2374)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.app.ActivityThread.installProvider(ActivityThread.java:7422)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.app.ActivityThread.installContentProviders(ActivityThread.java:6939)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6710)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.app.ActivityThread.access$1500(ActivityThread.java:247)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7839)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.squareup.leakcanary.core.R$bool" on path: DexPathList[[zip file "/data/app/~~LwwHkwGx7jncgn8_gERXpg==/my.app.test-ny0KPoKHCkMm7seeHjQrIA==/base.apk"],nativeLibraryDirectories=[/data/app/~~LwwHkwGx7jncgn8_gERXpg==/my.app.test-ny0KPoKHCkMm7seeHjQrIA==/lib/x86_64, /data/app/~~LwwHkwGx7jncgn8_gERXpg==/my.app.test-ny0KPoKHCkMm7seeHjQrIA==/base.apk!/lib/x86_64, /system/lib64, /system_ext/lib64]]
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-01 15:50:03.374 14346 14346 E AndroidRuntime: 	... 20 more

If I just don't include fat-aar plugin in the module, there's no issue.

Build Environment

  • Operating System: OS X 12.5.1
  • Gradle Plugin Version: com.android.library version 7.1.0
  • Gradle Version: 7.2
  • Fat-aar Version: 1.3.8
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

1 participant