“评估项目‘:app’时出现问题。”
我试着寻找这个错误的旧解决方案,但其中一些建议是更改版本。这是我应该做的吗?如果是这样的话,我应该改成什么版本?这是否与我的另一个错误"Plugin with id 'com.google.gms.google-services:4.3.10‘not found.“有关?
安卓/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.zipdarwin Flutter (通道稳定,2.5.2,在macOS 11.6 20G165✓-x64上,区域设置en-CA)
✓安卓工具链-为安卓设备开发(安卓软件开发工具包版本31.0.0)
适用于iOS和macOS的✓Xcode开发
✓Chrome -为web开发
✓安卓工作室(2020.3版)
发布于 2021-10-13 13:30:02
在'app/build.gradle‘文件中,顶部有:
apply plugin: 'com.google.gms.google-services:4.3.10'这不应该包括版本。
您可以在项目build.gradle文件(您发布的第一个文件)中定义版本
它应该是:
apply plugin: 'com.google.gms.google-services'https://stackoverflow.com/questions/69556183
复制相似问题