Cannot change dependencies of configuration \':app:api\' after it has been included in dependency resolution.
I was also getting the same error. Thanks to @Dominik for linking to the duplicate issue.
For now the work around is to downgrade com.google.gms:google-services to version 3.2.1 while the Android team works on a fix.
com.google.gms:google-services
3.2.1