shashi278 / social-auth-kivy

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

Compile error - GoogleAuth - buildozer #12

Closed kulothunganug closed 3 years ago

kulothunganug commented 3 years ago

Describe the bug When build a kivy app that uses kivyauth using buildozer it raises this error buildozer.spec

shashi278 commented 3 years ago

Hi! fontVariationSettings has been added in Android API 28 and above so could you try to re-build after changing API to 28 instead of 27 in your buildozer.spec file? Update android.api=27 to android.api=28 and let me know if that works.

kulothunganug commented 3 years ago

So, what I need to use in android.minapi?

shashi278 commented 3 years ago

Keep it default

kulothunganug commented 3 years ago

The app builded successfully, But when I try to login it opens google dialog box, when I click any of the account in that list The app gets restarted This is the error that occured 04-19 10:58:35.134 18327 18327 I python : [INFO ] [KivyAuth ] Error signing in using Google. JVM exception occurred: 10:

kulothunganug commented 3 years ago

Full log: https://ghostbin.com/paste/0ildq

shashi278 commented 3 years ago

This is the error that occured 04-19 10:58:35.134 18327 18327 I python : [INFO ] [KivyAuth ] Error signing in using Google. JVM exception occurred: 10:

Hard to tell where could be the error. It's not giving out any extra information. Can't say much without looking at the code :confused:

kulothunganug commented 3 years ago
from kivy.app import App
from kivy.lang import Builder
from kivyauth.google_auth import initialize_google, login_google, logout_google

KV = """
<LoginScreen@Screen>
    Button:
        text: 'Login'
        on_press: app.login()

<LogoutScreen@Screen>
    Button:
        text: 'Logout'
        on_press: app.logout()

ScreenManager:
    LoginScreen:
        name: 'login'
    LogoutScreen:
        name: 'logout'
"""
CLIENT_ID = "MY_CLIENT_ID"  # (Android)

class Application(App):
    def build(self):
        initialize_google(
            self.after_login,
            self.error_listener,
            CLIENT_ID
        )
        return Builder.load_string(KV)

    def login(self, *args):
        login_google()

    def logout(self):
        logout_google(self.after_logout)

    def after_login(self, name, email, photo_uri):
        print(name, email, photo_uri)
        self.root.current = "logout"

    def after_logout(self):
        self.root.current = "login"

    def error_listener(self):
        print("Error occured")
        exit()

if __name__ == "__main__":
    Application().run() 
shashi278 commented 3 years ago

Hi @Kulothungan16 It's working fine on my end. See below video and logcat image:

https://user-images.githubusercontent.com/37111736/115399473-e1b1e380-a205-11eb-9381-5ab5d4f1411d.mp4

Screenshot from 2021-04-20 18-17-34

Here's something you can try:

Also, you don't client ID for android and you need both the client ID and secret for desktop.

kulothunganug commented 3 years ago

You are correct I have specified org.kivy.auth for building the app but I provided com.kivy.auth while creating OAuth client. 😅 Give me some time to build and check

kulothunganug commented 3 years ago

Hey @shashi278 thank you very much!, all are working fine... 🙏

shashi278 commented 3 years ago

Really glad to know that :smile: and thanks for testing it out