I am following this link to integrate Google sign-in in my android app.https://developers.google.com/identity/sign-in/android/start-integrating As given in last step on the
In my case when i was using firebase services the google.json file was mismatched check once that also
I also faced the same issue. But I forgot to add google-services.json in my project. You can get this file from Google.
Also please check your package name in Manifest and package name in google services json file. If both have package name differ from one another u will have this issue.
I fixed it without deleting apply plugin: 'com.google.gms.google-services'
I had the error Execution failed for task ':app:processDebugGoogleServices'
because I was using two different versions of google services in my dependencies :
implementation "com.google.android.gms:play-services-maps:11.8.0"
implementation "com.google.android.gms:play-services-nearby:16.0.0"
I changed it to :
implementation "com.google.android.gms:play-services-maps:11.8.0"
implementation "com.google.android.gms:play-services-nearby:11.8.0"
Then it worked
Ensure that you have done these two things under defaultConfig
in Android/app/build.gradle
after wiring up Firebase for your Flutter app.
1) Whatever package name you entered while creating your Firebase android project, exactly the same should be updated as your applicationId
under defaultConfig
.
2) Add the line multiDexEnabled true
under defaultConfig
.
So defaultConfig{}
should now look something like this
defaultConfig {
applicationId "com.companyName.appName"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
NEVER DELETE apply plugin: 'com.google.gms.google-services' from the gradle. Sometimes you are using com.google.gms:google-services:3.1.0 , without apply plugin: 'com.google.gms.google-services' your gradle build successfully. BUT IT IS COMPLETELY WRONG !!!! This error comes due to google-service.json file is not at the correct location. Go to your PROJECT TAB at left side above. If you display it as ANDROID make it PROJECT then check your google-service.json file is at this location. EXPAND app then see google-service.json file below the build.gradle. IF NOT PLACE IT THERE BY RIGHT CLICK ON THE app .