To solve my problem here: Applying JaCoCo to all Android Studio gradle modules, I applied the solution here. This works fine so far for modules with
plugins {
id("com.android.library")
}
As soon as I add the required apply from: '../jacoco/modules.gradle'
into a module labeled as a Java library
plugins {
id("java-library")
}
I get a
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'android' for project ':lib1' of type org.gradle.api.Project.
I would like to add the apply from
to the java library, so that JaCoCo reports were generated for them as well. What am I missin here?
I assume you have also applied the snippet from the “Improvements” section of the solution you have linked to your
../jacoco/modules.gradle
file? In that case you could replace that snippet with the following:If that doesn’t solve it, then I’d recommend to run the build with Gradle’s
--stacktrace
option. That should give you more details on where exactly the missing property was found.Without more information on your exact build setup it’s hard to really say more.