shashi278 / social-auth-kivy

Integrate Google, Facebook, Github & Twitter login in kivy applications
MIT License
150 stars 23 forks source link

ApiException while trying to login with google #19

Closed AM-ash-OR-AM-I closed 2 years ago

AM-ash-OR-AM-I commented 2 years ago

Describe the bug After apk is built in buildozer App loads but on clicking user shows error

04-07 22:47:21.214 26594 27473 I python  : [INFO   ] [KivyAuth    ] Initiated google login
04-07 22:47:25.777 26594 26594 I python  : [INFO   ] [KivyAuth    ] google_activity_listener called.
04-07 22:47:25.780 26594 26594 I python  : [INFO   ] [KivyAuth    ] Error signing in using Google. JVM exception occurred: 10:  com.google.android.gms.common.api.ApiException

To Reproduce Steps to reproduce the behavior: basically same as demo app main.py

Desktop

Smartphone

Additional context Same as https://github.com/shashi278/social-auth-kivy/issues/15 Tried setting same app name and hash in cloud console still doesn't work. Also I tried Demo apk that doesn't work either only the one in playstore works. If you could update the apk with the code that you used will better. Also, can you tell where is client id being used for ANDROID? And if it is not used then why is it required to make project/ or make changes in cloud console?

AM-ash-OR-AM-I commented 2 years ago

Okay! So, finally understood what I needed to do!! Anybody facing this issue do these steps for ANDROID app:

  1. Assuming you have created Cloud console account and project in the field asking SHA-1 password, you need to run the following command in ubuntu/whatever you were using to make app. keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
  2. That will give you a SHA-1 password. Copy it and paste it here image
  3. After that you need to give correct package name. See the below snippet of buildozer.spec
    
    # (str) Package name
    package.name = appName

(str) Package domain (needed for android/ios packaging)

package.domain = org.appName


So, in the field of cloud console 
![image](https://user-images.githubusercontent.com/59698257/162384645-42c1a591-8a35-4235-83ed-695f4bceb180.png)
You need to give `package.domain + package.name` in this example it'll be `org.appName.appName`. Modify these requirements and then you are good to go! No, need for CLIENT_ID or CLIENT_SECRETS here.