From 5d404489867c132fd69d8a8352241c2e17659db1 Mon Sep 17 00:00:00 2001 From: Lucas SAUDON Date: Thu, 30 Apr 2026 21:35:01 +0200 Subject: [PATCH] Replace /android/build.gradle.kts by /android/app/build.gradle.kts --- .../for-app-developers.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/content/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers.md b/src/content/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers.md index 55132e8cd6..96f1cac1b3 100644 --- a/src/content/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers.md +++ b/src/content/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers.md @@ -52,10 +52,10 @@ further migration. First, find the `kotlin-android` plugin (or the `org.jetbrains.kotlin.android` plugin). It is likely located in the `plugins` block of the -`/android/build.gradle` or the -`/android/build.gradle.kts` file. +`/android/app/build.gradle` or the +`/android/app/build.gradle.kts` file. If you use the legacy `apply` syntax, it will be located in -the Groovy-based `/android/build.gradle` file, as this syntax is +the Groovy-based `/android/app/build.gradle` file, as this syntax is not supported in Kotlin DSL. The following examples demonstrate how to migrate a Flutter Android app @@ -68,7 +68,7 @@ and an add-to-app Android host app: **Before**: -```kotlin title="/android/build.gradle(.kts)" +```kotlin title="/android/app/build.gradle(.kts)" plugins { id("com.android.application") id("kotlin-android") @@ -88,7 +88,7 @@ android { Next, remove the `kotlin-android` plugin and the `kotlinOptions` block: -```kotlin diff title="/android/build.gradle.kts" +```kotlin diff title="/android/app/build.gradle.kts" plugins { id("com.android.application") - id("kotlin-android") @@ -106,7 +106,7 @@ Next, remove the `kotlin-android` plugin and the `kotlinOptions` block: Add the `kotlin.compilerOptions{}` DSL block with the following: -```kotlin diff title="/android/build.gradle.kts" +```kotlin diff title="/android/app/build.gradle.kts" + kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 @@ -118,7 +118,7 @@ Here is how the file will likely end up: **After**: -```kotlin title="/android/build.gradle(.kts)" +```kotlin title="/android/app/build.gradle(.kts)" plugins { id("com.android.application") // ... @@ -142,7 +142,7 @@ kotlin { **Before**: -```groovy title="/android/build.gradle" +```groovy title="/android/app/build.gradle" apply plugin: 'com.android.application' apply plugin: 'kotlin-android' // ... @@ -160,7 +160,7 @@ android { Next, remove the `kotlin-android` plugin and the `kotlinOptions` block: -```groovy diff title="/android/build.gradle" +```groovy diff title="/android/app/build.gradle" apply plugin: 'com.android.application' - apply plugin: 'kotlin-android' // ... @@ -175,7 +175,7 @@ Next, remove the `kotlin-android` plugin and the `kotlinOptions` block: ``` Add the `kotlin.compilerOptions{}` DSL block with the following: -```groovy diff title="/android/build.gradle" +```groovy diff title="/android/app/build.gradle" + kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 @@ -187,7 +187,7 @@ Here is how the file will likely end up: **After**: -```groovy title="/android/build.gradle" +```groovy title="/android/app/build.gradle" apply plugin: 'com.android.application' // ... @@ -215,7 +215,7 @@ Therefore, only the `plugins {}` block instructions are included. **Before**: -```kotlin title="/android/build.gradle(.kts)" +```kotlin title="/android/app/build.gradle(.kts)" plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) @@ -235,7 +235,7 @@ android { Next, remove the `kotlin-android` plugin and the `kotlinOptions` block: -```kotlin diff title="/android/build.gradle.kts" +```kotlin diff title="/android/app/build.gradle.kts" plugins { alias(libs.plugins.android.application) - alias(libs.plugins.kotlin.android) @@ -252,7 +252,7 @@ Next, remove the `kotlin-android` plugin and the `kotlinOptions` block: ``` Add the `kotlin.compilerOptions{}` DSL block with the following: -```kotlin diff title="/android/build.gradle.kts" +```kotlin diff title="/android/app/build.gradle.kts" + kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 @@ -264,7 +264,7 @@ Here is how the file will likely end up: **After**: -```kotlin title="/android/build.gradle(.kts)" +```kotlin title="/android/app/build.gradle(.kts)" plugins { alias(libs.plugins.android.application) // ...