Status Update
Comments
ze...@google.com <ze...@google.com>
sg...@google.com <sg...@google.com> #2
Retraced stack trace:
Caused by: java.lang.Error: Unexpected backport missing from Android U: java.util.stream.DoubleStream java.util.stream.DoubleStream.iterate(double, java.util.function.DoublePredicate, java.util.function.DoubleUnaryOperator)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.lookupBackportMethod(SupportedClassesGenerator.java:429)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.registerMethod(SupportedClassesGenerator.java:390)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.lambda$collectSupportedMembersInMinApi$5(SupportedClassesGenerator.java:336)
at com.android.tools.r8.com.google.common.collect.IndexedImmutableSet.forEach(IndexedImmutableSet.java:47)
at com.android.tools.r8.ir.desugar.desugaredlibrary.machinespecification.MachineRewritingFlags.forEachRetargetMethod(MachineRewritingFlags.java:159)
at com.android.tools.r8.ir.desugar.desugaredlibrary.machinespecification.MachineDesugaredLibrarySpecification.forEachRetargetMethod(MachineDesugaredLibrarySpecification.java:159)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.collectSupportedMembersInMinApi(SupportedClassesGenerator.java:335)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.run(SupportedClassesGenerator.java:91)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.run(DesugaredMethodsList.java:72)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.lambda$run$0(DesugaredMethodsList.java:63)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:80)
I made a few updates to backported methods in java.util.stream
classes.
If I use ~/Android/Sdk/platforms/android-33/android.jar
to run
java -cp build/libs/r8.jar com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList --output xxx.txt --lib ~/Android/Sdk/platforms/android-33/android.jar --min-api 17 --desugared-lib src/library_desugar/jdk11/desugar_jdk_libs.json --desugared-lib-jar third_party/openjdk/desugar_jdk_libs_11/desugar_jdk_libs.jar
on main
I get:
Error: java.lang.Error: Unexpected backport missing from Android U: int java.lang.CharSequence.compare(java.lang.CharSequence, java.lang.CharSequence)
Compilation failed with an internal error.
Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.utils.ExceptionUtils.withMainProgramHandler(ExceptionUtils.java:195)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.main(DesugaredMethodsList.java:93)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at Version.fakeStackEntry(Version_main.java:0)
at com.android.tools.r8.InternalCompilationFailedExceptionUtils.create(InternalCompilationFailedExceptionUtils.java:29)
at com.android.tools.r8.utils.ExceptionUtils.failWithFakeEntry(ExceptionUtils.java:145)
at com.android.tools.r8.utils.ExceptionUtils.failCompilation(ExceptionUtils.java:89)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:83)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:64)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.run(DesugaredMethodsList.java:52)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.run(DesugaredMethodsList.java:89)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.lambda$main$1(DesugaredMethodsList.java:96)
at com.android.tools.r8.utils.ExceptionUtils.withMainProgramHandler(ExceptionUtils.java:192)
... 1 more
Caused by: java.lang.Error: Unexpected backport missing from Android U: int java.lang.CharSequence.compare(java.lang.CharSequence, java.lang.CharSequence)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.lookupBackportMethod(SupportedClassesGenerator.java:429)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.addBackports(SupportedClassesGenerator.java:445)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.collectSupportedMembersInMinApi(SupportedClassesGenerator.java:330)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.run(SupportedClassesGenerator.java:91)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.run(DesugaredMethodsList.java:72)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.lambda$run$0(DesugaredMethodsList.java:63)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:80)
Using ~/Android/Sdk/platforms/android-34/android.jar
or ~/Android/Sdk/platforms/android-VanillaIceCream/android.jar
sg...@google.com <sg...@google.com> #3
Question to reporter: Which compileSdk
is used in the project?
pu...@gmail.com <pu...@gmail.com> #4
Thank you for looking into this. I'm using compileSdk 34
. I had no issue with Koala 2024.1.2 Canary 5.
I could verify that this issue happens in any project that has desugaring enabled:
android.compileOptions.coreLibraryDesugaringEnabled=true
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
...
}
For example, use the AS (Canary 6) "Basic Views Activity" template, modify its build.gradle
with lines above.
I have no idea why this function java.util.stream.DoubleStream java.util.stream.DoubleStream.iterate(double, java.util.function.DoublePredicate, java.util.function.DoubleUnaryOperator)
is appearing, since it was introduced in VanillaIcecream
and my app does not compile against it. Could it be an AGP / Lint issue (making use of R8) doing something with VanillaIcecream that it should not ?
sg...@google.com <sg...@google.com> #5
Thank you for reporting back.
This looks like it is caused by the API database embedded in D8/R8. It was updated to contain the Android V API's in
pu...@gmail.com <pu...@gmail.com> #6
Is there a version of R8 that I can manually revert to until this is fixed ?
Since AS Canary 6 is not really usable at the moment with desugaring which I believe most apps will have enabled, maybe it would be a good idea to ping the right people to revert to Canary 5.
ky...@gmail.com <ky...@gmail.com> #7
We are getting similar errors with compileSdk 34
.
Caused by: java.lang.Error: Unexpected backport missing from Android U: java.nio.file.Path java.nio.file.Files.writeString(java.nio.file.Path, java.lang.CharSequence, java.nio.file.OpenOption[])
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.lookupBackportMethod(SupportedClassesGenerator.java:429)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.registerMethod(SupportedClassesGenerator.java:390)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.lambda$collectSupportedMembersInMinApi$5(SupportedClassesGenerator.java:336)
at com.android.tools.r8.com.google.common.collect.IndexedImmutableSet.forEach(IndexedImmutableSet.java:47)
at com.android.tools.r8.ir.desugar.desugaredlibrary.machinespecification.MachineRewritingFlags.forEachRetargetMethod(MachineRewritingFlags.java:159)
at com.android.tools.r8.ir.desugar.desugaredlibrary.machinespecification.MachineDesugaredLibrarySpecification.forEachRetargetMethod(MachineDesugaredLibrarySpecification.java:159)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.collectSupportedMembersInMinApi(SupportedClassesGenerator.java:335)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.SupportedClassesGenerator.run(SupportedClassesGenerator.java:91)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.run(DesugaredMethodsList.java:72)
at com.android.tools.r8.ir.desugar.desugaredlibrary.lint.DesugaredMethodsList.lambda$run$0(DesugaredMethodsList.java:63)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:80)
FWIW we see it on one flavor that has minSdk 26
but not the other with minSdk 23
.
And this happens with AGP 8.6.0-alpha06
+ R8 8.6.4-dev
but not with AGP 8.6.0-alpha05
+ R8 8.6.6-dev
pu...@gmail.com <pu...@gmail.com> #8
I any case, downgrading R8 does not work (tried various 8.6.x and 8.5.x versions).
pu...@gmail.com <pu...@gmail.com> #9
Using the stable version of AGP (8.5.0
) do work as work-around for Gradle Sync to complete in AS Canary 6.
ja...@gmail.com <ja...@gmail.com> #10
I missed this issue and filed mine separately as
fl...@gmail.com <fl...@gmail.com> #11
ap...@google.com <ap...@google.com> #12
Branch: main
commit a9f9dd7b772eda669ec9b885e2453c9ce06bc32a
Author: Clément Béra <clementbera@google.com>
Date: Thu Jun 20 14:58:46 2024
Update DesugaredMethodList to work with old library
- Essentially missing methods in the library matter for html
doc generation more than for the lint, since no access flags
are required in the lint
Bug :
Change-Id: Ia7204b6d1fa1ba11a7f3eccebfa49de8e8c370ab
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/DesugaredMethodsList.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/GenerateDesugaredLibraryLintFiles.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/GenerateHtmlDoc.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/SupportedClassesGenerator.java
M src/test/java/com/android/tools/r8/desugar/desugaredlibrary/DesugaredMethodsListTest.java
M src/test/java/com/android/tools/r8/desugar/desugaredlibrary/PartialDesugaringTest.java
cl...@google.com <cl...@google.com> #13
I merged a fix here
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:8.6.11-dev")
}
}
}
pu...@gmail.com <pu...@gmail.com> #14
Thanks for the fix. Will test when 8.6.11-dev is available.
ap...@google.com <ap...@google.com> #16
Branch: 8.5
commit 50d2d438112f1ae305fcae45d9b8a51b6452ee64
Author: Clément Béra <clementbera@google.com>
Date: Mon Jun 24 13:37:00 2024
Update DesugaredMethodList to work with old library
- Essentially missing methods in the library matter for html
doc generation more than for the lint, since no access flags
are required in the lint
Bug :
Change-Id: Ia7204b6d1fa1ba11a7f3eccebfa49de8e8c370ab
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/DesugaredMethodsList.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/GenerateDesugaredLibraryLintFiles.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/GenerateHtmlDoc.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/lint/SupportedClassesGenerator.java
M src/test/java/com/android/tools/r8/desugar/desugaredlibrary/DesugaredMethodsListTest.java
M src/test/java/com/android/tools/r8/desugar/desugaredlibrary/PartialDesugaringTest.java
ap...@google.com <ap...@google.com> #17
Branch: 8.5
commit 23834c71ef57255063202688dbffdd258ad059b6
Author: Clément Béra <clementbera@google.com>
Date: Mon Jun 24 13:39:23 2024
Version 8.5.28
Bug:
Bug:
Change-Id: I642a3acb69b8f55b6417a4e66a56ec974aa52b47
M src/main/java/com/android/tools/r8/Version.java
cl...@google.com <cl...@google.com> #18
8.5.28 and 8.6.12-dev should have fixes for this. We can keep this open until someone verifies
pu...@gmail.com <pu...@gmail.com> #19
I confirm that both R8 8.6.12-dev and 8.5.28 work fine in conjunction with AGP 8.6.0-alpha07. Again, thanks for the fix !
cl...@google.com <cl...@google.com>
er...@gmail.com <er...@gmail.com> #20
I can also confirm 8.6.12-dev
fixed the issue for me. Thank you.
Will it be part of the release notes, whether it's in 8.6.0-alpha09
or another upcoming canary release?
pu...@gmail.com <pu...@gmail.com> #21
This issue is fixed in AS Ladybug 2024.1.3 Canary 1, as it uses R8 8.7.1-dev
(Interestingly this fix is not mentioned in the issue fixed list).
So if you had forced R8 8.6.12-dev
in your settings.gradle
, you can remove it now.
an...@google.com <an...@google.com> #22
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 Koala | 2024.1.1 Patch 2
- Android Gradle Plugin 8.5.2
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!
he...@gmail.com <he...@gmail.com> #23
* Android Studio Koala | 2024.1.1 Patch 2
* Android Gradle Plugin 8.4.0
sg...@google.com <sg...@google.com> #24
In response to
Description
I just upgraded from Koala 2024.1.2 Canary 5 to Canary 6 (which was just released), which upgraded AGP to
8.6.0-alpha06
and R8 to8.6.6-dev
.Since then, a Gradle sync of my project fails with in
java.lang.Error: Unexpected backport missing from Android U: java.util.stream.DoubleStream java.util.stream.DoubleStream.iterate(double, java.util.function.DoublePredicate, java.util.function.DoubleUnaryOperator)
.Here's the full gradle trace below.
Note that a
gradle assembleRelease
on the command line fails the same when it reaches thelintVitalAnalyzeRelease
task.I tried to configure the build to use the latest R8 release at this time (8.6.8-dev), but the error is the same.
If you need more info, let me know.