Gradle settings migration
Summary
#A change to enable the developer to edit Kotlin and Dart files with syntax highlighting and auto completion in Android Studio.
Context
#In order to detect Flutter and Gradle modules in the same IDE instance, the Gradle settings need to be moved so that the IDE can see both project types at once.
Migration guide
#Moving files
#The following files must be moved to the root directory of your project:
android/settings.gradle[.kts]
(with the.kts
suffix when you use the Kotlin script)android/build.gradle[.kts]
android/gradle.properties
android/local.properties
Changing files
#build.gradle.kts
#Change the newBuildDir
value from:
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
to:
val newBuildDir: Directory = rootProject.layout.buildDirectory.get()
build.gradle.kts
#Add the following line:
project(":app").projectDir = File(rootDir, "android/app/")
or build.gradle
#Add the following line:
project(':app').projectDir = new File(rootDir, 'android/app/')
When your project has multiple modules, add them in build.gradle[.kts]
and
replace the module name with the actual path.
Timeline
#In stable release: 3.34.0
References
#Relevant issue:
Relevant PR:
除非另有说明,本文档之所提及适用于 Flutter 的最新稳定版本,本页面最后更新时间: 2025-07-19。 查看文档源码 或者 为本页面内容提出建议.