Android Error: {"message":"Something went wrong"}
See original GitHub issueCondition: Pop up selection for google account appeared. Returning from pop up selection, error.
Device:
- Android 7.0
On application load:
E/Capacitor/Plugin/Console: Unhandled Promise rejection: Cannot read property 'content' of undefined ; Zone: <root> ; Task: null ; Value: {} TypeError: Cannot read property 'content' of undefined at HTMLScriptElement.<anonymous> (http://localhost/google-sign-in-google-sign-in-module.js:79:84) at Generator.next (<anonymous>) at http://localhost/google-sign-in-google-sign-in-module.js:52:71 at new ZoneAwarePromise (http://localhost/polyfills.js:3272:29) at push../node_modules/@codetrix-studio/capacitor-google-auth/dist/esm/web.js.__awaiter (http://localhost/google-sign-in-google-sign-in-module.js:48:12) at gapi.load (http://localhost/google-sign-in-google-sign-in-module.js:77:34) at https://apis.google.com/js/platform.js:18:214 at Sa (https://apis.google.com/js/platform.js:10:467) at Y (https://apis.google.com/js/platform.js:18:197) at Array.E.(anonymous function) (https://apis.google.com/js/platform.js:18:297)
On google signing in:
E/Capacitor/Plugin: Something went wrong com.google.android.gms.common.api.ApiException: 10: at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source) at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source) at com.codetrixstudio.capacitor.GoogleAuth.GoogleAuth.handleOnActivityResult(GoogleAuth.java:62) at com.getcapacitor.Bridge.onActivityResult(Bridge.java:720) at com.getcapacitor.BridgeActivity.onActivityResult(BridgeActivity.java:209) at android.app.Activity.dispatchActivityResult(Activity.java:6919) at android.app.ActivityThread.deliverResults(ActivityThread.java:4226) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4273) at android.app.ActivityThread.-wrap20(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1597) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6324) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1085) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:946) E/Capacitor/Plugin/Console: ERROR Error: Uncaught (in promise): Object: {"message":"Something went wrong"}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
Hi @atmosuwiryo, I would suggest putting a breakpoint in the catch block of
GoogleAuth.java
& get specifically (at least) thestatus code
returned.If I am picking it right tho,
com.google.android.gms.common.api.ApiException: 10: at
seems to yield status code 10, which means your API key is not properly configured to be used in your app.You will need to authenticate your client. Once you get the SHA-1 you will need to set it in Google Console Credentials for your Android key. Then use the WebClient Key in
string.xml
as explained in ReadMe.I will close this issue as it looks like a configuration issue. Feel free to reopen it if you have status code other than 10.
I just reused this plugin today. Found same error, but solved.
I was using android key in the strings.xml, it should be “web client id” like in this documentation https://github.com/CodetrixStudio/CapacitorGoogleAuth#android
Thank you for your help @Venryx @parveenkhtkr
I also found that there is different return value on success, between android and iOS. I got “name” on iOS and “displayName” on android.