无法在空对象上调用方法containsKey()

时间:2018-09-14 06:52:01

标签: android android-gradle google-play-services

我通过gradle构建Android项目时遇到此错误。大约每周发生一次。

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture snapshot of input files for task ':xxxxxxxx:compileDebugAidl' property 'importDirs' during up-to-date check.
> Cannot invoke method containsKey() on null object

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

任何想法都可能导致此错误吗?谢谢

2 个答案:

答案 0 :(得分:2)

直到该错误已由Google修复,到目前为止,降级到Play服务4.0.1似乎已解决了该问题:

sname

https://stackoverflow.com/a/50930048/4096987

答案 1 :(得分:2)

从@tapchicoma注释到原始问题,现在将问题NullPointerException in Google Services Plugin标记为4.2.0已解决。

因此,最终的解决方案是更新为:

classpath 'com.google.gms:google-services:4.2.0'