Status Update
Comments
ga...@google.com <ga...@google.com> #3
For Android-imposed version restrictions we should override that using AndroidLanguageFeatureProvider (and if the feature provider scheme isn't supported for a particular inspection, upstreaming a patch to add that).
so...@google.com <so...@google.com> #4
Actually now that I'm reading more carefully -- Objects.nonNull is one of the built-in methods that D8/R8 will automatically desugar. So in reality this shouldn't be a problem for anyone using recent versions of R8/D8 (which is pretty much everybody).
so...@google.com <so...@google.com> #5
I do see lint flagging it; let me take a look.
pa...@gmail.com <pa...@gmail.com> #6
Fixed by
xa...@google.com <xa...@google.com> #7
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 Ladybug Feature Drop | 2024.2.2 Canary 7
- Android Gradle Plugin 8.8.0-alpha07
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!
ga...@google.com <ga...@google.com> #8
Our custom lint rules are failing to compile after updating from alpha06 to alpha07 with the following error:
e: file:///builds/worker/workspace/build/src/mobile/android/gradle/dotgradle-online/caches/modules-2/files-2.1/com.android.tools.external.com-intellij/kotlin-compiler/31.8.0-alpha07/dfd505f95d9c8cea16956a0a1d33900234ce0259/kotlin-compiler-31.8.0-alpha07.jar!/META-INF/analysis-api-fe10.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
We're building with Kotlin 1.9.24 and Gradle 8.10. Is this expected?
ka...@google.com <ka...@google.com>
ka...@google.com <ka...@google.com> #9
That's unrelated to this bug scenario, right? Jinseong, does this sound familiar?
an...@google.com <an...@google.com> #10
That's unrelated to this bug scenario, right?
Yes, this is a different topic.
Our custom lint rules are failing to compile after updating from alpha06 to alpha07 with the following error:
e: file:///builds/worker/workspace/build/src/mobile/android/gradle/dotgradle-online/caches/modules-2/files-2.1/com.android.tools.external.com-intellij/kotlin-compiler/31.8.0-alpha07/dfd505f95d9c8cea16956a0a1d33900234ce0259/kotlin-compiler-31.8.0-alpha07.jar!/META-INF/analysis-api-fe10.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
We're building with Kotlin 1.9.24 and Gradle 8.10. Is this expected?
Yes, from 8.8 alpha06 to alpha07, we've upgraded kotlinc
bundled in Lint artifacts from 2.1.0-Beta1 to 2.1.0-Beta2. Since it's closer to RC, it started to refuse reading bytecode built w/ L-2 version. It means you don't have to catch all the way up to 2.1, but you can't stay in 1.9 either. So... it's good time to bump up to 2.0.
Google internal links:
^ here is the summary for external devs. LadyBug.2 canary cycles are about to end, and we're preparing the next version: Meerkat, along with IntelliJ 2024.3, which is now built with Kotlin LV 2.0, which forces us to build Android Studio / AGP w/ kotlinc 2.0+. When the 243 merge is done, the underlying kotlinc used in IJ will be 2.1 anyway, so this version up is inevitable.
ub...@gmail.com <ub...@gmail.com> #11
We're building with Kotlin 1.9.24 and Gradle 8.10.
It means you don't have to catch all the way up to 2.1, but you can't stay in 1.9 either. So... it's good time to bump up to 2.0.
I answered this in the email, but I can repeat that here as well. This is about reading bytecode/Metadata built with 2.1, and thus what you need is Kotlin compiler 2.0+. You may stay at language version 1.9 if you want and/or if that helps mitigating incompatible plugin issues.
I can confirm that we can decrease the language version too: 1.9 for Kotlin UAST artifacts we're building ourselves with some patches. However, other parts---Kotlin compiler, IntelliJ platform, and Java UAST---are still controlled by upstream repo/release. The error is also from kotlin-compiler-31.8.0-alpha07.jar
, so I'm afraid to say that lowering the LV for Kotlin UAST artifact only won't be effective at all.
ka...@google.com <ka...@google.com> #12
Sorry for keeping using this to communicate, but hopefully this is the last update.
Yes, from 8.8 alpha06 to alpha07, we've upgraded kotlinc bundled in Lint artifacts from 2.1.0-Beta1 to 2.1.0-Beta2. Since it's closer to RC, it started to refuse reading bytecode built w/ L-2 version.
I can confirm that that is indeed one big change:
However, other parts---Kotlin compiler, IntelliJ platform, and Java UAST---are still controlled by upstream repo/release.
I forgot that we're building Kotlin compiler by ourselves (as well as Kotlin UAST). So, by patching the revert of the aforementioned version up commit, I can lower the language versions of artifacts bundled in Android Lint. I'll make it land in 8.8 alpha08, then I expect you won't need to change anything regarding:
We're building with Kotlin 1.9.24 and Gradle 8.10.
Description
To improve the build experience for Android developers let's add a new build option to "Build Run configuration". This will perform the same build actions as the "Run" button, except that it will not deploy the app.
Let's also make this the default build behavior by mapping it to the hammer/build icon in the top toolbar. Given how close the hammer/build button is to the "Run" button, most developers expect it to build what they are about to deploy, not the whole project. Developers who want to build the whole project will still be able to do that through the "Make Project" option in the build menu.