Hi,
I see that according to Google APIs documentation apply plugin: 'com.google.gms.google-services' should be added at the bottom of the file and not at the top.
Add dependencies for basic libraries required for the services you have enabled. This step requires that the apply plugin: 'com.google.gms.google-services' line be at the bottom of your app/build.gradle file so that no dependency collisions are introduced. You can see the result of this step by running ./gradlew :app:dependencies.
https://developers.google.com/android/guides/google-services-plugin
Can someone please take a look? I am not able to update to the latest Google Services API.