Cannot invoke method containsKey() on null object

Viewed 1786

I got this error when I was building my Android project by gradle. It roughly happened once per week.

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

Any idea what may cause this error? thanks

2 Answers

From @tapchicoma comment to the original question, the issue: NullPointerException in Google Services Plugin now is marked as fixed for 4.2.0.

So, the final solution is to update to:

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