Android Studio Build Works but Tests Fail with Duplicate Classes Error

1,430 views
Skip to first unread message

gelafin (Mark)

unread,
Apr 19, 2022, 5:59:17 PM4/19/22
to And Bible
I'm able to run the app on my Pixel 4 API 29 AVD, but when I try running tests, I see this error about duplicate dependencies used in jetified-checker-3.1 and jetified-checker-qual-3.13.0:

Execution failed for task ':app:checkStandardDebugAndroidTestDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable


The output after this error lists many "Duplicate class org.checkerframework.someClass". For example:

> Duplicate class org.checkerframework.checker.compilermsgs.qual.CompilerMessageKey found in modules jetified-checker-3.1 (org.checkerframework:checker:3.1.1) and jetified-checker-qual-3.13.0 (org.checkerframework:checker-qual:3.13.0)

Stack Overflow says to either add "android.useAndroidX=true" and "android.enableJetifier=true" settings in gradle.properties, which I see is already done, or to choose one of the conflicting classes to exclude. 

Is there another setting I'm missing? Or, which of the modules' classes should I exclude?

My test settings seem to match the wiki developer guide:
Capture.JPG

Thanks,
Mark (GitHub: gelafin)

Tuomas Airaksinen

unread,
Apr 21, 2022, 12:27:28 PM4/21/22
to and-...@googlegroups.com
Hi,

Please post questions like this as a support / discussion ticket to github. I don't think developers follow this list closely (even for me this email went to spam folder). 

Does it work for you when you run tests from command line via gradle, i.e. ./gradlew testStandardRelease ?


--
You received this message because you are subscribed to the Google Groups "And Bible" group.
To unsubscribe from this group and stop receiving emails from it, send an email to and-bible+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/and-bible/3462a738-222d-47e7-a313-966b9dae6d3fn%40googlegroups.com.


--
T: Tuomas

gelafin (Mark)

unread,
Apr 27, 2022, 11:02:58 PM4/27/22
to And Bible
Sure, I'll post as GitHub tickets from now on.

For this one, since it does work using command line, I think that's fine! I just wasn't familiar with Android testing.

Reply all
Reply to author
Forward
0 new messages