Fixed
Status Update
Comments
ar...@google.com <ar...@google.com>
je...@google.com <je...@google.com>
hu...@google.com <hu...@google.com> #2
This was broken by 3bca759a5ff08352de831bb1e9b61b1ec2b3362d.
Fix (pending) is I2c2dc7b600603ee430fd0d91b23d52ea8aa29ca9.
Fix (pending) is I2c2dc7b600603ee430fd0d91b23d52ea8aa29ca9.
ma...@gmail.com <ma...@gmail.com> #3
Almost 2 months later and this is still broken
hu...@google.com <hu...@google.com> #4
Since there is no progression, I wanted to share our quick-fix for the issue.
#sdkmanager --package_file=${PATH_WORKSPACE}/packages
while read p; do echo "y" | sdkmanager "${p}"; done <${PATH_WORKSPACE}/packages
#sdkmanager --package_file=${PATH_WORKSPACE}/packages
while read p; do echo "y" | sdkmanager "${p}"; done <${PATH_WORKSPACE}/packages
hu...@google.com <hu...@google.com> #5
jb...@google.com What is the update on this?
an...@google.com <an...@google.com> #7
This has been fixed on master today (internal ref: ag/2945015) and will be available in the next SDK release.
Description
STEPS TO REPRODUCE:
1. Have a custom Gradle plugin
2. Add
```kotlin
tasks.withType<JavaCompile>().configureEach {
options.release.set(11)
}
```
3. Apply the plugin to all projects (including `org.jetbrains.kotlin.jvm` and `com.android.library`
4. Compile the project `./gradlew assemble`
5. Console gets polluted with:
```
WARNING: Using '--release' option could cause issues when using Android Gradle Plugin to compile sources with Java 9+. Instead, please set 'sourceCompatibility' and 'targetCompatibility' to the desired Java version, and set 'compileSdkVersion' to 30 or above. See
```
And the problem is I do want to set `--release`, as I want all task in the project use the same java version. Regardles if it's an Android or kotlin-only module.
I do have `sourceCompatibility` set.
I do have `compileSdk` set to >30, but I still see an error.
I expected to see a link explaining how to disable the warning, but it turns out the link is dead already.
I expected to see clear message explaining what kind of "issues" current config may cause.
If I remove the `--release` then my Kotlin modules will target wrong java version and the build fails with:
```
'compileJava' task (current target is 17) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain:
```
I don't expect to see a warning if I have everything set properly, or at least have a way to disable the invalid warning
Can you please share how to remove that warning?
ATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
------------------
IMPORTANT: Please read
all required information.
------------------
Studio Build: None
Version of Gradle Plugin: 8.0.0
Version of Gradle:
```
------------------------------------------------------------
Gradle 8.1
------------------------------------------------------------
Build time: 2023-04-12 12:07:45 UTC
Revision: 40ba32cde9d6daf2b92c39376d2758909dd6b813
Kotlin: 1.8.10
Groovy: 3.0.15
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 20 (Homebrew 20)
OS: Mac OS X 13.3.1 x86_64
```
Version of Java:
```
openjdk version "20" 2023-03-21
OpenJDK Runtime Environment Homebrew (build 20)
OpenJDK 64-Bit Server VM Homebrew (build 20, mixed mode, sharing)
```
OS: All