Status Update
Comments
ga...@google.com <ga...@google.com> #2
We will move to always using a single L8 invocation to process core library desugaring libraries. This task is cacheable and it should not impact the build speed negatively.
ga...@google.com <ga...@google.com> #3
The fix will be shipped in 4.1.0-beta04, and in 4.2.0-alpha05.
change ag/Ia1b241b2fee25ae43cda816f8b041a2e24acdadc
zs...@salesforce.com <zs...@salesforce.com> #4
I've tried this with both 4.1.0-beta04 and 4.2.0-alpha05 and it is still occurring :/. Slightly different error now though
java.lang.NoSuchMethodError: No direct method <init>(Ljava/util/Map;)V in class Lj$/util/m; or its super classes (declaration of 'j$.util.m' appears in /data/app/com.Slack.test-N8ok9kngoWUpMTt_roYrFA==/base.apk!classes2.dex)
at j$.util.DesugarCollections.synchronizedMap(Unknown Source:2)
at slack.telemetry.helper.FrameMetricsPlugin.<init>(FrameMetricsPlugin.kt:3)
at slack.telemetry.helper.FrameMetricsPlugin_Factory.get(FrameMetricsPlugin_Factory.java:2)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:5)
at slack.telemetry.helper.TracePluginsFactoryImpl_Factory.get(TracePluginsFactoryImpl_Factory.java:1)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:5)
at slack.telemetry.TraceProviderImpl_Factory.get(TraceProviderImpl_Factory.java:1)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:5)
at slack.telemetry.TracerImpl_Factory.get(TracerImpl_Factory.java:1)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:5)
ga...@google.com <ga...@google.com> #5
zs...@salesforce.com <zs...@salesforce.com> #6
Hmm, no I just see one. I think I've figured it out - in this case, this is occurring in a minified androidTest APK. j$/util/m
does exist in the tested app apk, but both it (the class, in this case SynchronizedMap
) and the DesugarCollections class are not in the test APK. This is failing from the test APK judging by the stacktrace (com.Slack.test
is the test APK package name), I'm not really sure why it's not using the class from the main app APK. I tried to force it with adding -keep class $j.**
in our test proguard rules, but it doesn't seem to be incorporated into L8's subsequent minification of the androidTest app.
Should I file a separate issue?
ga...@google.com <ga...@google.com> #7
In
Description
There are two immediate solutions to this:
1. Do only one L8 compilation passing both the desugared library and the custom conversions as inputs.
2. Do a D8 merge of the L8 compilations such that no duplicates are assured.