baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App crashes on google silent signin (Android)

vichanse opened this issue · comments

Hello,

My app crashes when i try to login using google. I get an illegalStateException: Task is not yet complete error
Here is the logcat
--------- beginning of crash 2020-04-09 05:33:45.166 5781-5909/com.kain.scovid19 E/AndroidRuntime: FATAL EXCEPTION: CapacitorPlugins Process: com.kain.scovid19, PID: 5781 java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.getcapacitor.Bridge$1.run(Bridge.java:529) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loop(Looper.java:166) at android.os.HandlerThread.run(HandlerThread.java:65) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) at com.getcapacitor.Bridge$1.run(Bridge.java:520) at android.os.Handler.handleCallback(Handler.java:808)  at android.os.Handler.dispatchMessage(Handler.java:101)  at android.os.Looper.loop(Looper.java:166)  at android.os.HandlerThread.run(HandlerThread.java:65)  Caused by: java.lang.IllegalStateException: Task is not yet complete at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29) at com.google.android.gms.tasks.zzu.zzb(Unknown Source:121) at com.google.android.gms.tasks.zzu.getResult(Unknown Source:19) at com.baumblatt.capacitor.firebase.auth.handlers.GoogleProviderHandler.isAuthenticated(GoogleProviderHandler.java:125) at com.baumblatt.capacitor.firebase.auth.CapacitorFirebaseAuth.signIn(CapacitorFirebaseAuth.java:112) at java.lang.reflect.Method.invoke(Native Method)  at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99)  at com.getcapacitor.Bridge$1.run(Bridge.java:520)  at android.os.Handler.handleCallback(Handler.java:808)  at android.os.Handler.dispatchMessage(Handler.java:101)  at android.os.Looper.loop(Looper.java:166)  at android.os.HandlerThread.run(HandlerThread.java:65)  2020-04-09 05:33:45.181 741-2714/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return. 2020-04-09 05:33:45.183 741-2714/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return. 2020-04-09 05:33:45.184 741-2714/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.

I use 'com.google.gms:google-services:4.3.3'as dependency and in my app build.gradle i have the dependencies below to firebase
implementation 'com.google.firebase:firebase-analytics:17.2.2' implementation 'com.google.firebase:firebase-auth:19.3.0' implementation 'com.google.firebase:firebase-firestore:21.4.0'

My capacitor.config.json file has this line included
"plugins": { "CapacitorFirebaseAuth": { "providers": ["google.com", "twitter.com", "facebook.com", "phone"], "languageCode": "en", "nativeAuth": false, "permissions": { "google": ["profile", "https://www.googleapis.com/auth/drive"] } } }
And below the dependencies in the package.json file
"@capacitor/android": "^2.0.0", "@capacitor/cli": "^2.0.0", "@capacitor/core": "^1.5.2", "@capacitor/ios": "^2.0.0", "@datorama/akita": "^4.22.0", "@datorama/akita-ng-forms-manager": "^3.3.0", "@ionic-native/core": "^5.0.0", "@ionic-native/splash-screen": "^5.0.0", "@ionic-native/status-bar": "^5.0.0", "@ionic/angular": "^5.0.0", "akita-ng-fire": "^2.0.0-rc.1", "capacitor-firebase-auth": "^0.3.0", "cordova-plugin-ionic": "5.4.6", "cordova-plugin-whitelist": "^1.3.4",

FYI i checked this issue #29 and it doesn't fix the problem.

Thank you for your help and your great job 👍

I am also having the same issue. Experiencing it after upgrading capacitor to version 2

You must log out first, before accessing the login function again

Had the same issue created a pull request with the edits that worked for me.

Hi,

The version 2.3.1 is out there with the fix introduced by @Just-Ghali on PR 82.

Please, let me know if you need more information or we can close this issue.

If you like this plugin, please don't forget to put a star on the project to help others to find it.

Best regards,
Bernardo Baumblatt

Hi,

The version 2.3.1 is out there with the fix introduced by @Just-Ghali on PR 82.

Please, let me know if you need more information or we can close this issue.

If you like this plugin, please don't forget to put a star on the project to help others to find it.

Best regards,
Bernardo Baumblatt

I am using the latest 2.3.2 but I am facing the same issue.
The app crashes as soon as you log in with google.