【发布时间】:2021-12-01 23:22:21
【问题描述】:
“评估项目 ':app' 时出现问题。”
我尝试查看此错误的旧解决方案,但其中一些建议是更改版本。那是我应该做的吗?如果是这样,我应该更改为哪个版本?这与我的其他错误“未找到 ID 为 'com.google.gms.google-services:4.3.10' 的插件”有关吗?
android/build.gradle:
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app/build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services:4.3.10'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.app.app"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.multidex:multidex:2.0.1'
}
gradel-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
[✓] Flutter (Channel stable, 2.5.2, on macOS 11.6 20G165 darwin-x64, locale en-CA)
[✓] Android 工具链 - 为 Android 设备开发(Android SDK 版本 31.0.0)
[✓] Xcode - 为 iOS 和 macOS 开发
[✓] Chrome - 为网络开发
[✓] Android Studio(版本 2020.3)
【问题讨论】:
-
您面临的错误是什么? “评估项目 ':app' 时出现问题。”之后呢?