Fixed
Status Update
Comments
uc...@google.com <uc...@google.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
ag...@google.com <ag...@google.com> #3
Ivan, has anything changes in the flags that are passed to D8 for the run button compared to other ways of building?
ga...@google.com <ga...@google.com> #4
Running the application from the IDE passes the same min api level as when building from the command line. Can you please add the following snippet to build.gradle and upload the output?
android.applicationVariants.all { variant ->
println "Variant ${variant.name } has min sdk version ${variant.getMergedFlavor().getMinSdkVersion()}"
}
android.applicationVariants.all { variant ->
println "Variant ${
}
rp...@gmail.com <rp...@gmail.com> #5
This correctly reports that they're all minimum API version 21.
> Configure project :app
Variant debug has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant release has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant myvariant has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
I don't know why the error messages relate to API 24 or 26 when we have successfully built/deployed the same product with other versions or toolchains.
> Configure project :app
Variant debug has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant release has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant myvariant has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
I don't know why the error messages relate to API 24 or 26 when we have successfully built/deployed the same product with other versions or toolchains.
ga...@google.com <ga...@google.com> #6
There should be more information in the logs, with information to enable desugaring (by adding compileOptions) or increase min sdk version. Can you please add the following snippet to build.gradle and share the output?
android.applicationVariants.all { variant ->
println "Variant ${variant.name } with Java 8 language support: ${((com.android.build.gradle.internal.variant.BaseVariantData) variant.variantData).scope.java8LangSupportType}"
}
android.applicationVariants.all { variant ->
println "Variant ${
}
rp...@gmail.com <rp...@gmail.com> #7
OK - I discovered that this fault does not occur (it deploys) in Studio 3.4 RC2 with:
com.android.tools.build:gradle:3.3.2
It does occur with:
com.android.tools.build:gradle:3.4.0-rc02
This is the output under 3.3.2:
Variant debug has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant debug with Java 8 language support: D8
Variant release has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant release with Java 8 language support: D8
Variant myvariant has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant myvariant with Java 8 language support: D8
This is the output under 3.4.0-rc02:
Variant debug has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant debug with Java 8 language support: D8
Variant release has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant release with Java 8 language support: R8
Variant myvariant has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant myvariant with Java 8 language support: R8
com.android.tools.build:gradle:3.3.2
It does occur with:
com.android.tools.build:gradle:3.4.0-rc02
This is the output under 3.3.2:
Variant debug has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant debug with Java 8 language support: D8
Variant release has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant release with Java 8 language support: D8
Variant myvariant has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant myvariant with Java 8 language support: D8
This is the output under 3.4.0-rc02:
Variant debug has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant debug with Java 8 language support: D8
Variant release has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant release with Java 8 language support: R8
Variant myvariant has min sdk version DefaultApiVersion{mApiLevel=21, mCodename='null'}
Variant myvariant with Java 8 language support: R8
rp...@gmail.com <rp...@gmail.com> #8
Apologies, I put those in the wrong order, now corrected.
ga...@google.com <ga...@google.com> #9
Can you try to create a sample project that reproduces the issue, as I was not able to reproduce?
There is also one strange thing about the logs. From #1, the variant that fails to build is "buildly", and D8 fails to process it. However, in #7 there is no buildly variant? Has the project changed in the meantime?
There is also one strange thing about the logs. From #1, the variant that fails to build is "buildly", and D8 fails to process it. However, in #7 there is no buildly variant? Has the project changed in the meantime?
rp...@gmail.com <rp...@gmail.com> #10
No, that's my failure to properly substitute out our actual variant names.
I will look at reproducing it with a sample project as time permits. If there's any factors that are likely to be important, then please advise. Alternatively I can share our full Gradle file in a private channel.
I will look at reproducing it with a sample project as time permits. If there's any factors that are likely to be important, then please advise. Alternatively I can share our full Gradle file in a private channel.
ga...@google.com <ga...@google.com> #11
You can email your build.gradle to gavra@google.com.
ga...@google.com <ga...@google.com> #12
With additional information, I was able to confirm that the issue is when Instant Run is enabled, and the variant is minified with R8.
For the variant, we report R8 as code shrinker and tool that will do the desugaring. However, with Instant Run we disable code shrinking, and D8 will run. Because desugaring does not specify D8 as the tool, we won't run desugaring with D8, which causes the issue in #1. I am working on a fix.
For the variant, we report R8 as code shrinker and tool that will do the desugaring. However, with Instant Run we disable code shrinking, and D8 will run. Because desugaring does not specify D8 as the tool, we won't run desugaring with D8, which causes the issue in #1. I am working on a fix.
ga...@google.com <ga...@google.com> #13
This should be fixed in the Android Gradle Plugin 3.4.1.
Change id: ag/I973bcd34a9a27ac46035688885ca714390d61528
Change id: ag/I973bcd34a9a27ac46035688885ca714390d61528
Description
Version of Gradle Plugin: 3.4.0-rc02
Version of Gradle: 5.1.1
Version of Java: 1.8.0_152
OS: macOS 10.14.3
We have a Kotlin project (I'm not currently able to publicly share the whole Gradle) that has a Java library dependency. The library requires Java 8.
Therefore we have set the following:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
In 3.4 RC2, when we use any build variant other than 'debug', the application compiles and I can build an APK to deploy manually, but I cannot deploy the app to a device via 'Run'. This was not a problem in 3.3.2.
We receive varying errors, e.g.:
Caused by: com.android.tools.r8.utils.AbortException: Error: Invoke-customs are only supported starting with Android O (--min-api 26)
or
Error: Default interface methods are only supported starting with Android N (--min-api 24): void [our library method name]()
A full example is included in the attached log.
I suspect that the Java compatibility options are being ignored. There are similar but not identical fault reports in play, e.g.