Status Update
Comments
am...@google.com <am...@google.com>
hm...@google.com <hm...@google.com> #2
hm...@google.com <hm...@google.com> #4
for all who are looking for a solution use this:
ey...@gmail.com <ey...@gmail.com> #5
You can repro it using this project and running ./gradlew tasks
If you edit nav-tree/build.gradle.kts
and replace android
with jvm
the issue doesn't occur. If you change it to not be multiplatform (change kotlin("multiplatform")
to kotlin("android")
and remove the kotlin
block), the issue does occur.
hm...@google.com <hm...@google.com> #6
I have had a look at this issue and managed to reproduce it. The warnings come from kapt plugin trying to access annotation processor options using the deprecated variant API in AGP. It may also happen when you are using libraries based on kapt such as Dagger. For the time being, I have removed the logging of the warning to avoid excessive noise to devs.
ey...@gmail.com <ey...@gmail.com> #7
It's happening in a bunch of projects where I don't use kapt at all.
ni...@hinge.co <ni...@hinge.co> #8
hm...@google.com <hm...@google.com> #9
It will be included in 8.0-beta01 and 8.1-alpha01 versions.
ni...@hinge.co <ni...@hinge.co> #10
Thanks! Until then I have a workaround. You can put this in your root build script:
val loggerFactory: ILoggerFactory = LoggerFactory.getILoggerFactory()
val addNoOpLogger: Method = loggerFactory.javaClass.getDeclaredMethod("addNoOpLogger", String::class.java)
addNoOpLogger.isAccessible = true
addNoOpLogger.invoke(loggerFactory, "com.android.build.api.component.impl.MutableListBackedUpWithListProperty")
addNoOpLogger.invoke(loggerFactory, "com.android.build.api.component.impl.MutableMapBackedUpWithMapProperty")
pa...@gmail.com <pa...@gmail.com> #11
Amazing #10, thank you for denoising my build :)
Quite sad it didn't make AGP 7.4.
Tip for anyone using the above workaround, you can remind yourself to remove it at the right time:
if (com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.startsWith("7.")) {
// ... workaround
} else {
error("AGP major version changed, review hack.")
}
ma...@gmail.com <ma...@gmail.com> #12
pa...@gmail.com <pa...@gmail.com> #13
Groovy doesn't care much about visibility and stuff, so you can just call the method (all hail dynamic languages! 😅):
if (com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.startsWith("7.")) {
org.slf4j.LoggerFactory.getILoggerFactory().addNoOpLogger("com.android.build.api.component.impl.MutableListBackedUpWithListProperty")
org.slf4j.LoggerFactory.getILoggerFactory().addNoOpLogger("com.android.build.api.component.impl.MutableMapBackedUpWithMapProperty")
} else {
throw new Exception("AGP major version changed, review hack.")
}
xa...@google.com <xa...@google.com> #14
Hakan, how risky is the fix that removes the excessive logging (I'm guessing not a lot)? It seems like it could be a good candidate for 7.4.2.
Jerome, what do you think?
je...@google.com <je...@google.com> #15
yes, it's fine to remove it.
hm...@google.com <hm...@google.com> #16
This is should be a fairly easy and risk-free change to cherry pick in 7.4.2. I will get on it.
Description
After updating from 7.4 Alpha 10 to Beta 1, the following starts getting printed when running Gradle:
I don't use
AnnotationProcessorOptions.arguments
anywhere in my build code.