提问人:Bitwise DEVS 提问时间:6/7/2021 最后编辑:Frank van PuffelenBitwise DEVS 更新时间:3/3/2023 访问量:13927
键入“UploadMappingFileTask”属性“googleServicesResourceRoot”没有配置值
Type 'UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value
问:
更新类路径后,我无法再构建应用程序的发布版本。
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:uploadCrashlyticsMappingFileRelease' (type 'UploadMappingFileTask').
- Type 'UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value.
Reason: This property isn't marked as optional and no value has been configured.
Possible solutions:
1. Assign a value to 'googleServicesResourceRoot'.
2. Mark property 'googleServicesResourceRoot' as optional.
A problem was found with the configuration of task ':app:uploadCrashlyticsMappingFileRelease' (type 'UploadMappingFileTask').
- Type 'UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value.
我试图阅读更新日志,但没有关于它的指南或文档。
答:
我也没找到任何东西,因为现在将 firebase-crashlytics-gradle 更改为 2.6.1 似乎没问题。
评论
要解决此问题,应先应用 Google 服务插件,然后再应用 ./app/build.gradle
这将产生以下错误:
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'
虽然这不会:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf
请注意,这是上面的。com.google.gms.google-services
com.google.firebase.crashlytics
当您更新和同步更改时,您会收到一条消息,指出这是修复程序,如下所示:com.google.firebase:firebase-crashlytics-gradle:2.7.0
Configure project :app
Crashlytics could not find Google Services plugin task: processReleaseGoogleServices. Make sure com.google.gms.google-services is applied BEFORE com.google.firebase.crashlytics. If you are not using the Google Services plugin, you must explicitly declare `googleServicesResourceRoot` inputs for Crashlytics upload tasks.
评论
确保
'com.google.gms.google-services'
应用前:
'com.google.firebase.crashlytics'
为我修复了错误。
评论
我的项目没有使用 .您需要在插件中向应用级 Gradle 文件添加,并在项目级 Gradle 文件中添加其对应的类路径依赖项。'com.google.gms.google-services'
'com.google.gms.google-services'
classpath 'com.google.gms:google-services:latest-version'
还要确保按照其他答案的规定出现在之前。com.google.gms.google-services
com.google.firebase.crashlytics
我已经按正确的顺序应用插件行,但我仍然收到有关未找到插件任务的构建错误和同步警告。我考虑过升级 google-services 的可能性,但 4.1.0 版是我能做到的。如果再高一点,我就会收到有关找不到库依赖项的错误。
事实证明,我不仅需要将 google-services 升级到 4.3.14,在项目级 build.gradle 中定义存储库是不够的;它还需要在应用级 build.gradle 中定义。mavenCentral()
buildscript {
repositories {
google()
mavenCentral() // Add this line
}
dependencies {
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
入门文档中没有一处提到需要这样做,所以希望这能帮助任何陷入与我相同情况的人。
当我在构建中进行测试时,这发生在我身上。minifyEnabled true
debug
将以下内容添加到我的调试 buildTypes 中为我解决了这个问题。
firebaseCrashlytics
{
mappingFileUploadEnabled false
}
评论