“評估專案‘: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
}
應用程式/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(通道穩定,2.5.2,在 macOS 11.6 20G165 darwin-x64,locale en-CA)
[?] Android 工具鏈 - 為 Android 設備開發(Android SDK 版本 31.0.0)
[?] Xcode - 為 iOS 和 macOS 開發
[?] Chrome - 為網路開發
[?] Android Studio(2020.3 版)
uj5u.com熱心網友回復:
在“app/build.gradle”檔案的頂部,您有:
apply plugin: 'com.google.gms.google-services:4.3.10'
這不應該包括版本。
您在專案 build.gradle 檔案中定義版本(您發布的第一個)
它應該只是:
apply plugin: 'com.google.gms.google-services'
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/312644.html
