You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The Flutter Gradle plugin's configureLegacyPluginEachProjects function problem #155484
The Flutter Gradle plugin's configureLegacyPluginEachProjects Groovy code is detecting the text content of the existing settings.gradle file, regardless of whether it is in comments or the main body.
Even if I comment out the '.flutter-plugins' string in the settings.gradle file, the Flutter Gradle plugin still recognizes that it is using the legacy settings.gradle configuration method.
As a result, during flutter build apk or flutter run command, it outputs error logs saying, "Plugin project : listed, but not found. Please fix your settings.gradle/settings.gradle.kts."
I think we just looked at the existence of the file and if both exist we use the legacy file. If I recall correctly this mirrors the behavior of other gradle plugins.
Can you share why you want 2 different settings files so I can better understand the use case?
@gmackall do you think we should read the contents of these files to determine which to pick? I am leaning against making that change.
I think we just looked at the existence of the file and if both exist we use the legacy file. If I recall correctly this mirrors the behavior of other gradle plugins.
Can you share why you want 2 different settings files so I can better understand the use case?
@gmackall do you think we should read the contents of these files to determine which to pick? I am leaning against making that change.
Okay. I will show you 2 different settings files:
The first one generates the error(or warning) logs during flutter build apk or flutter run command, but the last one doesn't.
The firlst settings.gradle file:
pluginManagement {
def flutterSdkPath = {
def properties =newProperties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath !=null, "flutter.sdk not set in local.properties"return flutterSdkPath
}()
println"flutterSdkPath: $flutterSdkPath"
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.4.0" apply false
id "com.google.gms.google-services" version "4.3.15" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}
include ":app"
The second settings.gradle file:
// include ':app'// def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()// def plugins = new Properties()// def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') <--- This generates error logs even if it is commented text.// if (pluginsFile.exists()) {// pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }// }// plugins.each { name, path ->// def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()// include ":$name"// project(":$name").projectDir = pluginDirectory// }
pluginManagement {
def flutterSdkPath = {
def properties =newProperties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath !=null, "flutter.sdk not set in local.properties"return flutterSdkPath
}()
println"flutterSdkPath: $flutterSdkPath"
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.4.0" apply false
id "com.google.gms.google-services" version "4.3.15" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}
include ":app"
Ah thank for explaining. I thought you were getting caught on setting.gradle vs settings.gradle.kts. I see why you would want commented out lines ignored.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
reidbaker commentedon Sep 23, 2024
I think we just looked at the existence of the file and if both exist we use the legacy file. If I recall correctly this mirrors the behavior of other gradle plugins.
Can you share why you want 2 different settings files so I can better understand the use case?
@gmackall do you think we should read the contents of these files to determine which to pick? I am leaning against making that change.
goosetapa commentedon Sep 24, 2024
Okay. I will show you 2 different settings files:
The first one generates the error(or warning) logs during flutter build apk or flutter run command, but the last one doesn't.
The firlst settings.gradle file:
pluginManagement { def flutterSdkPath = { def properties = new Properties() file("local.properties").withInputStream { properties.load(it) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath }() println "flutterSdkPath: $flutterSdkPath" includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") repositories { google() mavenCentral() gradlePluginPortal() } } plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.4.0" apply false id "com.google.gms.google-services" version "4.3.15" apply false id "org.jetbrains.kotlin.android" version "1.8.22" apply false } include ":app"The second settings.gradle file:
reidbaker commentedon Sep 24, 2024
Ah thank for explaining. I thought you were getting caught on setting.gradle vs settings.gradle.kts. I see why you would want commented out lines ignored.
Remove block and line comments when detecting '.flutter-plugins' in s…
github-actions commentedon Nov 25, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.