Это мое приложение/build.gradle
Код: Выделить всё
plugins {
id "com.android.application"
id "kotlin-android"
id "com.google.gms.google-services"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
dependencies {
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:33.9.0')
// Add required Firebase dependencies here
implementation 'com.google.firebase:firebase-messaging'
}
android {
compileSdk 35 //rootProject.ext.compileSdkVersion
namespace = "com.example.kommunappen"
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
defaultConfig {
applicationId "com.example.kommunappen"
minSdk 28//rootProject.ext.minSdkVersion
targetSdk 35 //rootProject.ext.targetSdkVersion
versionCode flutter.versionCode
versionName flutter.versionName
}
println("compileSdkVersion: " + android.compileSdkVersion)
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
flutter {
source = "../.."
}
plugins {
id 'com.android.application'
id "kotlin-android"
id 'com.google.gms.google-services' version '4.4.2' apply true
}
ext {
kotlin_version = '1.8.20'
compileSdkVersion = 35
targetSdk = 35
minSdk = 28
appCompatVersion = "1.6.1"
playServicesLocationVersion = "21.3.0"
hmsLocationVersion = "6.12.0.300"
removeBackgroundGeolocationDebugSoundsInRelease = false
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "${project(':flutter_background_geolocation').projectDir}/libs" }
maven { url 'https://developer.huawei.com/repo/' }
maven { url "${project(':background_fetch').projectDir}/libs" }
jcenter()
}
}
println("DEBUG: compileSdkVersion from ext is: " + ext.compileSdkVersion)
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
}
< /code>
my println дает
debug: compilesdkversion from ext: 35
compilesdkversion: android-35 < /p>
Все еще я получаю Ошибка:
Проблема произошла настройка корневого проекта 'Android'. < /p>
com. android.builder.errors.evalissueException: CompilesDkversion не указан. Пожалуйста, добавьте его в build.gradle < /p>
< /blockquote>
Я попытался создать свой проект Android и ожидал, что он будет работать. Вместо этого он бросает эту ошибку, и я не могу понять, что не так.
Подробнее здесь: https://stackoverflow.com/questions/794 ... version-is