admin管理员组文章数量:1405990
So, I am encountering an issue. I just upgraded to flutter stable version 3.27.4. In my pubspec.yaml: environment: sdk: ^3.6.0
When I try to run my app. I get the following error:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\manit\fvm\versions\stable\packages\flutter_tools\gradle\build.gradle.kts' line: 7
* What went wrong:
Could not apply requested plugin [id: '.gradle.kotlin.kotlin-dsl', version: '4.4.0'] as it does not provide a plugin with id '.gradle.kotlin.kotlin-dsl'. This is caused by an incorrect plugin implementation. Please contact the plugin author(s).
My android settings.gradle. Looks like this:
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
}()
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.7.0' apply false
id ".jetbrains.kotlin.android" version "2.0.20" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
}
include ":app"
While in my android/app/build.gradle. I have the following:
android {
compileSdkVersion 35
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
kotlinOptions {
jvmTarget = "21"
}
kotlin {
jvmToolchain(21)
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
Could my java version be what is causing the issues ? I have been using jvm version 21 for 2 months now for my project. In the file 'C:\Users\manit\fvm\versions\stable\packages\flutter_tools\gradle\build.gradle.kts' line: 7. It looks like this: import .jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
`java-gradle-plugin`
groovy
`kotlin-dsl`
kotlin("jvm") version "1.9.20"
}
Could a mismatch in java versions be the issue ? Any help would be great.
本文标签: flutterCould not apply requested plugin id 39orggradlekotlinkotlindsl39Stack Overflow
版权声明:本文标题:flutter - Could not apply requested plugin [id: 'org.gradle.kotlin.kotlin-dsl' - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744969784a2635166.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论