Fixed
Status Update
Comments
gg...@google.com <gg...@google.com> #2
This can be either an issue with interface method desugaring, most likely one of the dependency has now new static/default/private methods on interfaces which is incorrectly supported by our compiler, or it's an issue with desugared library, or both.
To rule the options out:
- Are you using desugared library in your project (https://developer.android.com/studio/write/java8-support-table )?
- What is the minSdk of your project? If it's strictly below 24, and you change it to 24, and let us know if the issue happens.
If you want us to help you further, for example by helping you build a work-around, or fix the compiler, we need you to either provide us a reproduction project (github or zip) or a compilation dump of your application (See how to generate dumps herehttps://r8.googlesource.com/r8/+/refs/heads/main/doc/compilerdump.md ).
Thanks for the report.
To rule the options out:
- Are you using desugared library in your project (
- What is the minSdk of your project? If it's strictly below 24, and you change it to 24, and let us know if the issue happens.
If you want us to help you further, for example by helping you build a work-around, or fix the compiler, we need you to either provide us a reproduction project (github or zip) or a compilation dump of your application (See how to generate dumps here
Thanks for the report.
vi...@google.com <vi...@google.com> #3
Yes, I'm using desugaring, version 1.2.2 (to work with LocalDate). I tried to build a signed apk with disabled desugaring and the build was successful.
In my project minSdk is 24.
Unfortunately I can't provide you the source code or dump as this is a confidential project, but I can provide a list of dependencies, build.gradle files and a class that works with LocalDate if that helps, or maybe smth else, but not a whole project(
In my project minSdk is 24.
Unfortunately I can't provide you the source code or dump as this is a confidential project, but I can provide a list of dependencies, build.gradle files and a class that works with LocalDate if that helps, or maybe smth else, but not a whole project(
ra...@google.com <ra...@google.com>
pa...@google.com <pa...@google.com>
tn...@google.com <tn...@google.com> #5
Retracing from Stack overflow gives:
Caused by: com.android.tools.r8.errors.Unreachable: Attempt to enqueue an action in a non pushable enqueuer work list.
at com.android.tools.r8.shaking.EnqueuerWorklist$NonPushableEnqueuerWorklist.attemptToEnqueue(EnqueuerWorklist.java:800)
at com.android.tools.r8.shaking.EnqueuerWorklist$NonPushableEnqueuerWorklist.enqueueMarkMethodLiveAction(EnqueuerWorklist.java:856)
at com.android.tools.r8.shaking.Enqueuer.markMethodAsLiveWithCompatRule(Enqueuer.java:4882)
at com.android.tools.r8.shaking.Enqueuer.markMethodAsTargeted(Enqueuer.java:4773)
at com.android.tools.r8.shaking.Enqueuer.lambda$markVirtualMethodAsReachable$88(Enqueuer.java:3387)
at com.android.tools.r8.graph.MethodResolutionResult$SingleProgramResolutionResult.visitMethodResolutionResults(MethodResolutionResult.java:897)
at com.android.tools.r8.graph.MethodResolutionResult.forEachMethodResolutionResult(MethodResolutionResult.java:103)
at com.android.tools.r8.shaking.Enqueuer.markVirtualMethodAsReachable(Enqueuer.java:3340)
at com.android.tools.r8.shaking.Enqueuer.traceInvokeInterface(Enqueuer.java:1463)
at com.android.tools.r8.shaking.Enqueuer.traceInvokeInterface(Enqueuer.java:1447)
at com.android.tools.r8.shaking.DefaultEnqueuerUseRegistry.registerInvokeInterface(DefaultEnqueuerUseRegistry.java:86)
at com.android.tools.r8.cf.code.CfInvoke.internalRegisterUse(CfInvoke.java:153)
at com.android.tools.r8.cf.code.CfInstruction.registerUse(CfInstruction.java:104)
at com.android.tools.r8.graph.CfCode.registerCodeReferences(CfCode.java:683)
at com.android.tools.r8.graph.ProgramMethod.registerCodeReferences(ProgramMethod.java:127)
at com.android.tools.r8.shaking.Enqueuer.traceCode(Enqueuer.java:4809)
at com.android.tools.r8.shaking.Enqueuer.traceNonDesugaredCode(Enqueuer.java:4803)
at com.android.tools.r8.shaking.Enqueuer.markMethodAsLive(Enqueuer.java:4742)
at com.android.tools.r8.shaking.EnqueuerWorklist$MarkMethodLiveAction.run(EnqueuerWorklist.java:166)
at com.android.tools.r8.shaking.Enqueuer.postProcessingDesugaring(Enqueuer.java:4540)
at com.android.tools.r8.shaking.Enqueuer.trace(Enqueuer.java:4477)
at com.android.tools.r8.shaking.Enqueuer.traceApplication(Enqueuer.java:3622)
at com.android.tools.r8.R8.runEnqueuer(R8.java:1012)
at com.android.tools.r8.R8.run(R8.java:369)
at com.android.tools.r8.R8.run(R8.java:252)
at com.android.tools.r8.R8.lambda$runForTesting$1(R8.java:243)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:80)
... 34 more
an...@google.com <an...@google.com> #6
This comes from the desugaring post processing. It could be:
- desugared library retargeting
interface method desugaring(not in 1.2 with 24)- api callback
record(not generating methods)disable desugarer(not generating method)
What's going on is that R8 is verifying that code generated in the post processor is targeting already traced code.
Is there in the app any override of the following 3 methods: [java.time.ZoneId java.util.TimeZone.toZoneId(), java.time.ZonedDateTime java.util.GregorianCalendar.toZonedDateTime(), java.time.Instant java.util.Date.toInstant()] ?
Alternatively, it could be that something not traced as a library override is now traced with the callback? @mkroghj wasn't there a change on library override computation and tracing?
Description
kotlin always let ()->Unit as Runnable. But android Handler cannot removeCallbacks. Ex:
Above code will be compiled into:
The ()->Unit function has be wrapped by diff lambda, it's not same one. So, the android Handler can't removeCallback.
We have to replace with Runnable statement.
Could you please add some warning message just like SharedPreferences' commit() to removeCallback when using kotlin?