Status Update
Comments
ad...@google.com <ad...@google.com>
di...@google.com <di...@google.com>
ni...@hinge.co <ni...@hinge.co> #2
di...@google.com <di...@google.com> #3
(reposting under work account)
We have been hitting this issue constantly. Is it possible to configure those tasks to be non cacheable as a workaround or is that only possible inside of AGP?
ak...@google.com <ak...@google.com> #4
Currently the only way to disable caching for dexing transforms is to patch AGP manually by providing a patched DexTransform.kt
file in buildSrc
. Please see
da...@gmail.com <da...@gmail.com> #5
Thanks. Ignoring potential build perf impacts, if we essentially commented out the processIncrementally
block in DexingTransform.kt
and always ran non-incrementally, would that workaround this issue?
ni...@hinge.co <ni...@hinge.co> #6
Yes, always run the dex transform non-incrementally is another workaround.
ni...@hinge.co <ni...@hinge.co> #7
xa...@google.com <xa...@google.com> #8
I guess so, could you give it a try?
je...@google.com <je...@google.com>
am...@google.com <am...@google.com> #9
Anyway, what about issue, I've tried a lot of attempts to fix and helped only turn off jacoco transformation `useJacocoTransformInstrumentation = false`.
What was changed in agp 7.4.x from 7.3.1 that break this?
am...@google.com <am...@google.com> #10
Are you referring to
(Regarding What was changed in agp 7.4.x from 7.3.1 that break this?
: I don't know, my theory is that some of your code has changed too when updating AGP, which exposed the Jacoco bug. Please post your comments in that issue if you'd like to continue discussing this.)
bi...@google.com <bi...@google.com>
bi...@google.com <bi...@google.com> #11
Edit: we were actually not applying the patch correctly, so this was user error.
We've been running with a patched version of DexingTransformer.kt for about a week but are still seeing the issue. First I tried commenting out @CacheableTransform
on DexingNoClasspathTransform
, but after devs were still experiencing the error, I tried reverting that change and instead applying what I'd suggested in
Is there any other workaround or additional information I can provide to help debug? At first I thought it's perhaps the patched version of DexingTransformer.kt
wasn't being picked up, but I confirmed that it was by throwing an exception inside of doTransform
.
am...@google.com <am...@google.com>
am...@google.com <am...@google.com>
ni...@ansman.se <ni...@ansman.se> #12
Regarding the non-cacheable fix: Can you check if it actually takes effect (i.e., the transform outputs are not cached)? Maybe comment out @CacheableTransform
in the BaseDexingTransform
class too?
Regarding the non-incremental fix: Note that the stacktrace in
at com.android.build.gradle.internal.dependency.BaseDexingTransform.processIncrementally(DexingTransform.kt:227)
at com.android.build.gradle.internal.dependency.BaseDexingTransform.doTransform(DexingTransform.kt:137)
Please check your stacktrace after applying the non-incremental fix:
- If it still shows
processIncrementally
, that means the fix was not applied successfully. - If it shows
processNonIncrementally
, that is probably a different bug.
am...@google.com <am...@google.com> #13
Thanks! I did confirm we were not applying the patch correctly (as you pointed out, processIncrementally
was in the callstack) but we are now. I will report back if we're still having issues. Appreciate the support.
an...@google.com <an...@google.com> #15
Is it possible to cherry-pick changes to AGP 8.0?
ni...@hinge.co <ni...@hinge.co> #16
Thanks, but I'm afraid that it's a bit late for AGP 8.0.
(Btw, as mentioned at
Description
A -> B -> C where they depend on each other in order using an `implementation` scoped dependency.
Module B provides a composable function that uses a composition local from module C.
If module A does not have an explicit dependency on module C, attempting to preview something that uses this composable function from B in module A leads to the preview failing to render with a `ClassNotFoundException` for the class referenced in module C.
It looks something like this:
```
// Module A
@Composable
@Preview
fun PreviewStuff() {
PreviewContent { ... }
}
// Module B
@Composable
fun PreviewContent(content: @Composable () -> Unit) {
CompositionLocalProvider(LocalStuff provides stuff) {
content()
}
}
// Module C
object LocalStuff {
private val LocalStuff = compositionLocalOf< Stuff?> { null }
val current: Stuff
@Composable
get() = LocalStuff.current
?: findStuff()
infix fun provides(stuff: Stuff): ProvidedValue<Stuff?> = LocalStuff(stuff)
}
```
------------------
Studio Build: Android Studio Iguana | 2023.2.1 Beta 1 (also happens on Jellyfish canaries)
Version of Gradle Plugin: 8.2.1
Version of Gradle: 8.5
Version of Java: 21
OS: macOS Sonoma 14.2