问题
i have two build flavours. Each have debug and release build types.
i having two googleservice.json for two build flavours. All are working fine except gmail login.
In local gmail login works fine. But after uploading app to playstore, gmail login not works. i update two sha1 key for debug and release in firebase console.and get the latest googleservice.json file.
But still facing issue on play store.
And i am having this in my proguard
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
And i m refering all your stackoverflow question but still not get a answer.
Thanks, Arunraj M
回答1:
Add the SHA1 key of my release key (the .jks file) in the Google Developers Console under the project registered.
In Android Studio, at the left side, there is an option for Build variants under the project view. There, I changed each module to release mode (it is in debug mode by default). Then created the Signed APK by usual method, and run the app.
The Google Signin worked perfectly.
follow this link Google sign in signed apk not working
and after adding SHA-1 Google Developers Console replace with google-services.json
NOTE: JSON file of google should only one in project
回答2:
The problem is you are using the debug sha1 keys You have to generate release SHA1 keys
In order to generate Release SHA1 first go to your JAVA JRE Bin folder and open command prompt there or directly open Command prompt and go to your JAVA JRE bin folder, for example: C:\Program Files (x86)\Java\jre7\bin>
Then use command below to generate release SHA1 keys,
keytool -list -v -keystore <keystore_path> -alias <alias_name>
Example:
My Keystore Path: D:\AndroidProjects\my_app_key_store.jks
My Alias Name: my_app_alias
Now use the command below to generate your own keytool path:
keytool -list -v -keystore D:\AndroidProjects\my_app_key_store.jks -alias my_app_alias
来源:https://stackoverflow.com/questions/44277768/google-sign-in-not-working-after-publishing-in-play-store-with-having-two-sha1-k