Code: Select all
plugins {
id("com.android.application")
id("kotlin-android")
id("dev.flutter.flutter-gradle-plugin")
}
android {
namespace = "xx.xxxxx.xx"
compileSdk = 36
ndkVersion = "29.0.13846066"
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}
defaultConfig {
applicationId = "xx.xxxxx.xx"
minSdk = 30
targetSdk = 34
versionCode = flutter.versionCode
versionName = flutter.versionName
}
buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
}
}
buildToolsVersion = "36.0.0"
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk11:2.0.20")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
implementation("androidx.core:core:1.13.1")
}
flutter {
source = "../.."
}
< /code>
Wenn ich jedoch versuche, das Projekt zu erstellen, begegne ich den folgenden Fehler, auch nachdem ich verschiedene Versionen der Kotlin -Standardbibliothek getestet habe: < /p>
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk11:2.2.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk11/2.2.0/kotlin-stdlib-jdk11-2.2.0.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk11/2.2.0/kotlin-stdlib-jdk11-2.2.0.pom
- https://storage.googleapis.com/download.flutter.io/org/jetbrains/kotlin/kotlin-stdlib-jdk11/2.2.0/kotlin-stdlib-jdk11-2.2.0.pom
Required by:
project :app
< /code>
Zusätzlicher Kontext < /strong>: < /p>
[*] Ich bin im Iran, wo Netzwerkbeschränkungen den Zugang zu Maven -Repositorys beeinflussen könnten. Ich habe versucht, mehrere Proxys zu verwenden, aber ich erhalte immer noch 404 Fehler beim Zugriff auf die obigen URLs in einem Browser. Die Datei der Einstellungen.Gradle
Ich habe versucht, die Version der Kotlin -Standardbibliothek auf 2.0.20 und 1.9.24 zu ändern, aber der Fehler bleibt bestehen, und es scheint nach 2.2.0 .>