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
@xiao-cao-x
I am not sure, but the tool may not be supporting the Kotlin DSL yet. Can you provide flutter doctor -v, all related build.gradle files along with error log you get ?
@bartekpacia Alright. This issue was most recently mentioned there, so that's why looked for answers there as well. For my case they are related, since I want to migrate from Groovy to Kotlin.
@Daphne-CoffeeIT Sure! For a very simple example app that is migrated from Gradle Groovy DSL to Gradle Kotlin DSL, check out this one in Flutter repo (link). There are some redundant stuff.
I can also share buildfiles of my private app that is migrated from Groovy to Kotlin:
settings.gradle.kts
pluginManagement {
val flutterSdkPath =run {
val properties = java.util.Properties()
file("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
require(flutterSdkPath !=null) { "flutter.sdk not set in local.properties" }
flutterSdkPath
}
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("dev.flutter.flutter-plugin-loader")
// Consult before bumping:// https://developer.android.com/studio/releases#android_gradle_plugin_and_android_studio_compatibility
id("com.android.application") version "8.2.2" apply false
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
id("com.google.gms.google-services") version "4.4.1" apply false
id("com.google.firebase.crashlytics") version "2.9.9" apply false
}
include(":app")
@bartekpacia Thanks, but I do have the Kotlin code, that's not the issue. It's just that Flutter and most Flutter tools, for example when running flutterfire configure, don't support it yet. They look for gradle files instead of gradle.kts files. That and millions of other issues show that Flutter currently doesn't (fully) support it yet. And then I read all over the internet that it indeed doesn't, so I migrated back. If you have different information I'd love to see the source!
Ah, sorry to hear that. At this point it's up to the ecosystem to adapt to Gradle Kotlin DSL.
I don't see what else Flutter could do here (in addition to providing some guidance for plugin/package authors)
I think our tooling now checks for build.gradle.kts in addition to build.gradle.
flutterfire issues cant be resolved in this repository. If there is a more specific issue please file it but in general I think the work @bartekpacia did to support kotlin dsl solves this issue.
Will leave this comment for a bit to see if others disagree then will close this issue.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.
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
darshankawar commentedon Nov 9, 2021
@xiao-cao-x
I am not sure, but the tool may not be supporting the Kotlin DSL yet. Can you provide
flutter doctor -v, all related build.gradle files along with error log you get ?darshankawar commentedon Nov 18, 2021
@xiao-cao-x Can you provide above ?
darshankawar commentedon Nov 18, 2021
I tried to find similar / duplicate for this request, but couldn't find any, so keeping it open for further insights on this.
13 remaining items
DRSchlaubi commentedon Aug 18, 2023
The Kotlin DSL is no the default, so this should receive more attention
References:
Daphne-CoffeeIT commentedon May 31, 2024
Any updates? From this issue it seems like some things are happening: #121541. But I still have issues and can't use KSP
bartekpacia commentedon May 31, 2024
@Daphne-CoffeeIT Issue #121541 is unrelated to this one.
Daphne-CoffeeIT commentedon May 31, 2024
@bartekpacia Alright. This issue was most recently mentioned there, so that's why looked for answers there as well. For my case they are related, since I want to migrate from Groovy to Kotlin.
bartekpacia commentedon May 31, 2024
@Daphne-CoffeeIT Sure! For a very simple example app that is migrated from Gradle Groovy DSL to Gradle Kotlin DSL, check out this one in Flutter repo (link). There are some redundant stuff.
I can also share buildfiles of my private app that is migrated from Groovy to Kotlin:
settings.gradle.kts
pluginManagement { val flutterSdkPath = run { val properties = java.util.Properties() file("local.properties").inputStream().use { properties.load(it) } val flutterSdkPath = properties.getProperty("flutter.sdk") require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } flutterSdkPath } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") repositories { google() mavenCentral() gradlePluginPortal() } } plugins { id("dev.flutter.flutter-plugin-loader") // Consult before bumping: // https://developer.android.com/studio/releases#android_gradle_plugin_and_android_studio_compatibility id("com.android.application") version "8.2.2" apply false id("org.jetbrains.kotlin.android") version "2.0.0" apply false id("com.google.gms.google-services") version "4.4.1" apply false id("com.google.firebase.crashlytics") version "2.9.9" apply false } include(":app")build.gradle.kts
app/build.gradle.kts
Hope it helps!
Daphne-CoffeeIT commentedon May 31, 2024
@bartekpacia Thanks, but I do have the Kotlin code, that's not the issue. It's just that Flutter and most Flutter tools, for example when running
flutterfire configure, don't support it yet. They look forgradlefiles instead ofgradle.ktsfiles. That and millions of other issues show that Flutter currently doesn't (fully) support it yet. And then I read all over the internet that it indeed doesn't, so I migrated back. If you have different information I'd love to see the source!bartekpacia commentedon May 31, 2024
Ah, sorry to hear that. At this point it's up to the ecosystem to adapt to Gradle Kotlin DSL.
I don't see what else Flutter could do here (in addition to providing some guidance for plugin/package authors)
reidbaker commentedon Jul 2, 2024
I think our tooling now checks for build.gradle.kts in addition to build.gradle.
flutterfire issues cant be resolved in this repository. If there is a more specific issue please file it but in general I think the work @bartekpacia did to support kotlin dsl solves this issue.
Will leave this comment for a bit to see if others disagree then will close this issue.
github-actions commentedon Jul 23, 2024
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.
github-actions commentedon Aug 6, 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.