Status Update
Comments
cl...@google.com <cl...@google.com>
cl...@google.com <cl...@google.com> #2
ap...@google.com <ap...@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?
ap...@google.com <ap...@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
ap...@google.com <ap...@google.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?
ap...@google.com <ap...@google.com> #6
Yes, always run the dex transform non-incrementally is another workaround.
ap...@google.com <ap...@google.com> #7
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #8
I guess so, could you give it a try?
ap...@google.com <ap...@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?
ap...@google.com <ap...@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.)
an...@google.com <an...@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
.
an...@google.com <an...@google.com> #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.
Description
Versions
Description
When processing jar files to generate dex files using D8 and R8 respectively, the resulting dex files behave inconsistently during execution. The dex file generated by R8 crashes upon execution with the error "Exception in thread 'main' java.lang.NullPointerException," which should actually be caught. In contrast, the dex file generated by D8 executes normally. We suspect this is an issue with R8.
Step to Reproduce
Expected Result(d8 dex output)
Actual Result(r8 dex output)
Testcase Source Code
rules.pro