|
1 | 1 | [//]: # (title: Migrating a Kotlin Multiplatform project to support AGP 9.0) |
2 | 2 |
|
3 | | -Kotlin Multiplatform projects with Android targets which were created using the Android Gradle plugin version earlier |
4 | | -than 9.0 |
5 | | -need to be restructured to upgrade to AGP 9.0. |
6 | | -Several APIs needed for KMP configuration are hidden in AGP 9.0 and eventually are going to be removed. |
7 | | -To solve this in the long term, we recommend updating your project structure to isolate AGP usage to an Android module. |
| 3 | +Projects where multiplatform modules configured Android targets using the `com.android.application` plugin |
| 4 | +need to be restructured to upgrade to Android Gradle plugin 9.0. |
| 5 | +AGP deprecates several APIs, but provides a new [Android Gradle Library plugin](https://developer.android.com/kotlin/multiplatform/plugin) |
| 6 | +to be used instead. |
8 | 7 |
|
9 | | -On top of AGP compatibility, there is an issue of migrating to the |
10 | | -new [Android Gradle Library plugin](https://developer.android.com/kotlin/multiplatform/plugin). |
11 | | -In the following guide, we highlight changes related to this as well. |
| 8 | +The following guide shows how to swap the plugins and restructure the project at the same time. |
12 | 9 |
|
13 | | -> To make your project work with AGP 9.0 in the short term, you can manually enable the hidden APIs. |
| 10 | +> To make your project work with AGP 9.0 in the short term, you can manually enable the deprecated APIs. |
14 | 11 | > To do that, in the `gradle.properties` file of your project add this property: |
15 | 12 | > `android.enableLegacyVariantApi=true`. |
16 | 13 | > |
17 | | -> The legacy API is going to be removed completely in AGP 10, make sure you finish the migration before that! |
| 14 | +> The legacy APIs are going to be removed completely in AGP 10, make sure you finish the migration before that! |
18 | 15 | > |
19 | 16 | {style="note"} |
20 | 17 |
|
|
0 commit comments