⚠️IMPORTANT PSA FOR MULTIPLATFORM/ANDROID LIBRARY AUTHORS⚠️TL;DR: Publishing multiplatform libraries with Android Gradle Plugin 7.1.0-alpha13 (or higher) will require Kotlin Gradle Plugin 1.6.10 (or higher).
We detected a recent incompatibility between newer pre-release Android Gradle Plugin versions and the current Kotlin Multiplatform Gradle Plugin.
To be more precise: Starting from AGP version 7.1.0-alpha13, Android related Gradle configurations will set an internal attribute that will unfortunately be copied by Kotlin during the publication process of a library.
This Gradle attribute will effectively tell Gradle, that the Library is only compatible with builds using the exact same AGP version. Obviously, this is not correct and not desirable.
Libraries published with this attribute will therefore be almost “un-consumable” by users.____________
Consequences for you (the Library author)
When upgrading AGP to 7.1.0-alpha13 (or higher), make sure you are using Kotlin Gradle Plugin 1.6.10 (or higher) to create proper publications.
When using AGP 7.1.0-alpha12 (or lower), this does not affect you.____________
Consequences for you (Application Developer)
We know, that issues like this are uncomfortable for users. Integrating Android into multiplatform is hard and this is not the first time we suffered from Android+Multiplatform issues.
We (the Kotlin, more precise the Kotlin Multiplatform Core, Team) are aware of this and are actively working together with Google (more precise the AGP team) to find better ways of working together/integrating.
Some very ambiguous plans were made recently and we started working on it already.____________
The workaround on the Kotlin Gradle Plugin side can be tracked here:https://youtrack.jetbrains.com/issue/KT-49798This is currently in review and is planned to be shipped in 1.6.10Thanks folks and I hope you’ll have a more enjoyable Friday than I do 😁:kotlin:
A blog post might be a very good idea! I will be meeting the AGP team this week. Let’s see what their decision will be on this matter. It is still possible to add a compatibility rule on their side, so that this incompatibility won’t make it into any release.
Will keep you up-to-date here (and will consider writing a blog post, if actions will still be required afterwards)
10 months ago
Thanks for the suggestions, we're going to repost a message like this in other channels, Kotlin Twitter and nearest patch notes/blog posts/what's new.