Status Update
Comments
au...@google.com <au...@google.com> #2
AndroidX already does the following to suppress the javac warning
project.tasks.withType(JavaCompile::class.java).configureEach { task ->
// JDK 21 considers Java 8 an obsolete source and target value. Disable this warning.
task.options.compilerArgs.add("-Xlint:-options")
}
}
but AGP prints another warning on top of it.
ar...@google.com <ar...@google.com>
ga...@google.com <ga...@google.com>
au...@google.com <au...@google.com> #3
Note, this is blocking androidx upgrading to AGP 8.5.0 as we get about 500 multi-line warnings. We'd really like a way to suppress it, so it would be nice if this was a P1.
hu...@google.com <hu...@google.com> #4
Sure, I'll prioritize fixing this issue, marking it as blocking AGP 8.4 and 8.5 now.
ga...@google.com <ga...@google.com> #5
Hung, can you please also fix warning duplication? We should avoid reporting this issue per subproject, and somehow summarize it.
hu...@google.com <hu...@google.com> #6
Starting with AGP 8.5.0-alpha05, the following Gradle property will suppress the warnings: android.javaCompile.suppressSourceTargetDeprecationWarning = true
Change:
We will be backporting this change to AGP 8.4.1 as well, leaving this bug open until that's done.
Thank you for this report!
Hung, can you please also fix warning duplication? We should avoid reporting this issue per subproject, and somehow summarize it.
As discussed offline, de-duplication is nice but is not super necessary once we have provided the users with an option to suppress the warnings. We can consider de-duplication not just for this warning but for all warnings in general when there is really a need, but that will be a separate project.
au...@google.com <au...@google.com>
hu...@google.com <hu...@google.com> #7
Appreciate your sign-off, but we probably need to keep this bug open to ensure the backport to AGP 8.4.1 happens.
We will be backporting this change to AGP 8.4.1 as well, leaving this bug open until that's done.
hu...@google.com <hu...@google.com>
an...@google.com <an...@google.com> #8
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 Jellyfish | 2023.3.1 Patch 1
- Android Gradle Plugin 8.4.1
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!
Description
When building AGP
8.5.0-alpha03
, JDK 21 and targeting java 1.8 (androidx set up) a warning prints out:Given that JDK still does allow building Java 1.8 bytecode, there should be away to supress this warning until the support for this bytecode version is removed (like java 1.7).