更新类路径后,我无法再构建应用程序的发布版本。
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.
我尝试阅读变更日志,但没有相关指南或文档。
6条答案
按热度按时间4nkexdtk1#
要解决这个问题,Google服务插件应该在
/app/build.gradle
中的任何Firebase插件之前应用。这将产生以下错误:
虽然这并不:
请注意,
com.google.gms.google-services
在**com.google.firebase.crashlytics
之上。当您更新到
com.google.firebase:firebase-crashlytics-gradle:2.7.0
并同步更改时,系统会显示一条消息,说明已修复,如下所示:az31mfrm2#
确保
适用于:
帮我修正了错误。
w8rqjzmb3#
我也没有发现任何东西,现在改变到2.6.1的firebase-crashlytics-gradle似乎可以。
frebpwbc4#
我的项目没有使用
'com.google.gms.google-services'
。您需要将'com.google.gms.google-services'
添加到插件中的应用级Gradle文件,并在项目级Gradle文件中添加其对应的类路径依赖项classpath 'com.google.gms:google-services:latest-version'
。此外,请确保
com.google.gms.google-services
位于com.google.firebase.crashlytics
之前,如其他答案所述。mi7gmzs65#
我已经把apply plugin行按正确的顺序写好了,但是我仍然收到构建错误和关于插件任务找不到的同步警告。我考虑过升级google-services的可能性,但是4.1.0版本已经是我能做到的最高版本了。再高的话,我就会收到关于库依赖项找不到的错误。
事实证明,我不仅需要将google-services升级到4.3.14,在项目级构建中定义
mavenCentral()
存储库。它还需要在应用程序级build. gradle中定义。在入门文档中没有任何地方提到需要这样做,所以希望,这将帮助任何陷入与我相同情况的人。
l7wslrjt6#
当我在我的
debug
构建中测试minifyEnabled true
时,发生了这种情况。向我的调试构建类型添加以下内容为我解决了这个问题。