Is there a way to disable androidTest compile/asse...
# android
a
Is there a way to disable androidTest compile/assemble on a per module basis? I can only find disabling the whole task type that would disable it in the whole project We have one module using androidTest (everything else is just test with robolectric), but having that one androidTest module results in Android studio 'Make Project' compiling and assembling androidTest for every module -- so my full project build takes forever, and it eats a ton of disk space as it basically creates the same 200mb apk for each module in our 150 module project. This wasn't true like a year ago but one of the AGP upgrades I think changed the behavior (used to see it only in canary but now release android studio does it too)
not kotlin but kotlin colored 2
a
thanks! How do I use that? Ideally in my root build.gradle I could apply it on all the subprojects, we have existing global modifications are usually by plugin... variant API is project wide? Caused by: groovy.lang.MissingPropertyException: No such property: androidTest for class: com.android.build.gradle.LibraryPlugin
e
Copy code
androidComponents.beforeVariants { variant ->
    variant.androidTest.enable = false
}
but please note the not kotlin but kotlin colored and ask questions about Android that do not depend on Kotlin in other appropriate communities
306 Views