Jonathan
09/05/2025, 4:15 PMandroidLibrary{} is no longer recommended.
The guide contains the following excerpts:
Note: Since Kotlin Gradle Plugin version 2.2.0-Beta2 and Android Gradle Plugin version 8.12.0-alpha04, a new configuring block exists calledThis seems contradictory because adding a new KMP module in my project, it creates build.gradle.kts file that contains analongside theandroid{}one. TheandroidLibrary{}block is deprecated and will be removed in a future release of AGP, so migrate to theandroidLibrary{}block.android{}
androidLibrary {}. I'm using Android Studio Narwhal 3 Feature Drop and I have the most update to date version of the Kotlin Multiplatform plugin (0.9-251.26094-AS-85).
Furthermore, there is additional code snippets in the guide that use androidLibrary {}. Can anyone lend some expertise on the subject and help clear up my confusion?tapchicoma
09/05/2025, 5:07 PMandroid {} DSL was once available in KMP plugin, but was recently removed. It was used to integrate with "com.android.application" or "com.android.library" plugins
• Temporary androidTarget {} DSL was introduced to free android name, but still support the same Android plugins
• Meanwhile androidLibrary {} name was used by new "com.android.kotlin.multiplatform.library" plugin
• In the recent AGP 8.12 release "com.android.kotlin.multiplatform.library" plugin reclaimed android {} DSL
androidTarget {} will be deprecated in Kotlin 2.3.0 release and removed in some following releases.Jonathan
09/05/2025, 5:12 PMandroid {} DSL or is it safe to continue to use androidTarget {}?tapchicoma
09/05/2025, 5:13 PMandroid {} namespace.
As I wrote above androidTarget {} will be soon deprecated.Jonathan
09/05/2025, 5:15 PMandroidLibrary {} .tapchicoma
09/05/2025, 5:16 PMandroidLibrary {} AFAIK also will be deprecated in some future AGP releasesJonathan
09/05/2025, 5:16 PMandroid {}. Do you know when the plugin will be updated to use the correct DSL?tapchicoma
09/05/2025, 5:16 PMandroid {} will staytapchicoma
09/05/2025, 5:17 PMJonathan
09/05/2025, 5:22 PMandroidLibrary {} to the newly supported android {} is as simple as changing the name or are there additional changes that need to be made?efemoney
09/05/2025, 6:34 PMPearce Keesling
09/06/2025, 4:54 PM