Status Update
Comments
ra...@google.com <ra...@google.com>
sp...@google.com <sp...@google.com>
sp...@google.com <sp...@google.com> #2
za...@gmail.com <za...@gmail.com> #3
Look like this was introduced by the fix for
sp...@google.com <sp...@google.com> #4
I can't add the property using gradle.beforeProject
like i've been able to do with other plugins (kapt) that have similar isolation issues. Perhaps because the JetGradlePlugin is added and executed earlier than my own code.
za...@gmail.com <za...@gmail.com> #6
Thanks for the patch - I'll cherry pick and adapt internally
sp...@google.com <sp...@google.com> #7
za...@gmail.com <za...@gmail.com> #8
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Canary 9
- Android Gradle Plugin 8.8.0-alpha09
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
sp...@google.com <sp...@google.com> #9
I'm using Ladybug Feature Drop RC02 and the issue is back, did the change get reverted?
an...@google.com <an...@google.com> #10
I reviewed the details shared and I was unable to reproduce it on my end using the steps on RC1
, RC2
but being able to reproduce it on Canary6
(since fix landed on Canary9
).
I also checked that fix is actually present on the AS Ladybug Feature
release branch, however, this isn’t public yet but you can see those for the beta instead more in particular 2024.2.2-beta01
tag:
Having said that will be great if you can provide more details, since there's no sign so far that those changes got reverted somehow.
As a side note there’s the possibility that even if the fix is present as shown the change might not be taken into consideration in the case that platform artifact embedded in studio isn’t updated properly including it. I would say this is unlikely to happen due to automatic processes.
ju...@yahooinc.com <ju...@yahooinc.com> #11
When I commented earlier, I made extra certain that I was indeed using RC02. However since then I've been unable to duplicate again. My suspicion is that somehow the JetGradlePlugin from Ladybug was being used by Ladybug Feature Drop as I have both installed.
sp...@google.com <sp...@google.com> #12
Was a resolution ever found to the MissingValueException? I am seeing the same issue
Not that I know of.
Are you hitting that after trying the workaround from #4?
If so, does using AGP 8.8.0-alpha02 or newer fix the original problem for you?
ju...@yahooinc.com <ju...@yahooinc.com> #13
Are you hitting that after trying the workaround from #4?
No, I am seeing the issue from #8 without having hit the original issue. I've been attempting to debug myself, but as the original reporter said, it can be frustrating to debug configuration internals in gradle.
However I have managed to work around it. As the original reporter said, I believe there is somewhere where AGP is setting a provider value on kapt stub gen KotlinCompile tasks with
I acknowledge that you were unable to find a location where this occurs, so possible this is being performed in kapt library. But the project I am working on uses freeCompilerArgs minimally, and I don't believe we are causing this ourselves.
Avoid the e via the following setup in the applicable areas where freeCompilerArgs are being set (simplified for sharing purposes):
android {
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
try {
freeCompilerArgs.appendAll(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
)
} catch (e: MissingValueException) {
freeCompilerArgs.set(mutableListOf())
freeCompilerArgs.appendAll(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
)
}
}
}
}
sp...@google.com <sp...@google.com> #14
Thanks for the info!
If you use AGP 8.8.0-alpha02 or newer, do you still need the workaround in #13?
ju...@yahooinc.com <ju...@yahooinc.com> #15
sp...@google.com <sp...@google.com> #16
Thanks for the info. Any chance you can create a repro project hitting the MissingValueException
? I wasn't able to repro it on my side previously.
ju...@yahooinc.com <ju...@yahooinc.com> #17
Any chance you can create a repro project hitting the MissingValueException? I wasn't able to repro it on my side previously.
Apologies, this would not be something I would have the chance to do with my current workload.
I did note though, that when swapping freeCompilerArgs.append/appendAll
for freeCompilerArgs.add/addAll
the failure re-emerged. This is of interest to me since append* gets removed in Gradle 8.8:
ju...@yahooinc.com <ju...@yahooinc.com> #18
Update:
The issue did lie in our usage of freeCompilerArgs
. Traced the issue back to the following format in root build.gradle.kts
. This setup had worked prior to upgrading to 2.0.0. Was able to work around the issue once I was aware of what caused it.
subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.add(*any arg here*)
}
}
}
You should be able to reproduce now with this setup in any project.
sp...@google.com <sp...@google.com> #19
Thanks for the update! I filed
Description
I've been trying out kotlin test fixtures in AGP 8.5 was surprised to find that classes compiled by these tasks were using the jvm-target of our running JDK (22) in our case, and not the one our convention plugin sets for all KotlinCompile tasks (17).
After some digging and disallowChanges use to track down who was overriding this, it looks like AGP sources kotlinOptions from
android.kotlinOptions
? tbh I didn't realize this DSL still existed, and kinda wonder why. Is this intentional? Confirmed that if I manually set these values separately, it works as expected.Could these be deduped (or at least source from the same convention as other KGP tasks?). The reason I ask is because this means to use testFixtures, our convention plugin would have to add a separate, somewhat duplicate code path to configure kotlin options just for AGP test fixtures that uses legacy APIs (i.e.
kotlinOptions
and not the new property-basedcompilerOptions
).