无法确定任务 ':app:uploadCrashlyticsMappingFileRelease' 与 Google 版本 4.3.9 版本的依赖关系
Could not determine the dependencies of task ':app:uploadCrashlyticsMappingFileRelease' with Google Version 4.3.9 version
下一个问题发生在构建发布时 APK/Bundle
它只发生在最新版本的 'com.google.gms:google-services:4.3.9'
上,它适用于 'com.google.gms:google-services:4.3.8'
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:uploadCrashlyticsMappingFileRelease'.
> Could not create task ':app:processReleaseGoogleServices'.
> DefaultTaskContainer#NamedDomainObjectProvider.configure(Action) on task set cannot be executed in the current context.
build.gradle(应用):
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
...
// Firebase
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation 'com.google.firebase:firebase-crashlytics'
...
build.gradle(根):
buildscript {
ext.kotlin_version = "1.5.21"
repositories {
google()
mavenCentral()
maven {
url "https://jitpack.io"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.9'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}
gradle插件版本:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
Studio 版本:AndroidStudio Arctic Fox | 2020.3.1
可能是什么问题?
在根级别 build.gradle
中升级 google-services plugin
classpath 'com.google.gms:google-services:4.3.10' // change version here
此问题在 4.3.9
版本中遇到,已在 4.3.10
中修复
来自:- https://firebase.google.com/support/release-notes/android#google-services_plugin_v4-3-10
下一个问题发生在构建发布时 APK/Bundle
它只发生在最新版本的 'com.google.gms:google-services:4.3.9'
上,它适用于 'com.google.gms:google-services:4.3.8'
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:uploadCrashlyticsMappingFileRelease'.
> Could not create task ':app:processReleaseGoogleServices'.
> DefaultTaskContainer#NamedDomainObjectProvider.configure(Action) on task set cannot be executed in the current context.
build.gradle(应用):
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
...
// Firebase
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation 'com.google.firebase:firebase-crashlytics'
...
build.gradle(根):
buildscript {
ext.kotlin_version = "1.5.21"
repositories {
google()
mavenCentral()
maven {
url "https://jitpack.io"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.9'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}
gradle插件版本:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
Studio 版本:AndroidStudio Arctic Fox | 2020.3.1
可能是什么问题?
在根级别 build.gradle
中升级 google-services plugin
classpath 'com.google.gms:google-services:4.3.10' // change version here
此问题在 4.3.9
版本中遇到,已在 4.3.10
来自:- https://firebase.google.com/support/release-notes/android#google-services_plugin_v4-3-10