CapacitorGoogleAuth icon indicating copy to clipboard operation
CapacitorGoogleAuth copied to clipboard

something went wrong

Open GOLHS opened this issue 1 year ago • 30 comments

error Error: Something went wrong at returnResult (VM3:912:32) at win.androidBridge.onmessage (VM3:887:21)

GOLHS avatar Jan 13 '24 19:01 GOLHS

Facing the same issue with error code 10 I have tried all the web client id, server client id, android client id and everything, replacing them with each other. Still the same error.

malvinder avatar Jan 16 '24 07:01 malvinder

I also faced the same problem

agnusdei1207 avatar Jan 27 '24 08:01 agnusdei1207

just now i clear it that issue!

https://velog.io/@agnusdei1207/angular-ionic-capacitor-google-oauth2-plugin-feat.-android-ios

sha-1 key issue..! only use android studio tool gradle and use gradle signingReport

The sha-1 key continues to change depending on how it is generated. The most stable method is the above method.

agnusdei1207 avatar Feb 08 '24 15:02 agnusdei1207

Facing the same issue. Not sure what it is as it was working before. Did anybody find a solution?

image

RobinRosculete avatar Mar 21 '24 03:03 RobinRosculete

Same problem here... Couldn't find any solution yet.

@RobinRosculete

alon42 avatar Mar 26 '24 16:03 alon42

I was struggling with this error for hours!!! But then, while checking the demo and following the readme.md, I realized that I was missing a configuration in a file: android/app/src/main/res/values/strings.xml

In the demo, you can find it at: https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/master/demo/android/app/src/main/res/values/strings.xml

Once I added the with the Google clientId, everything started to work :)

Good day <3

Naza2021 avatar Mar 28 '24 16:03 Naza2021

Finally managed to make it work!! Ionic - vue

  1. under android/app/build.gradle make sure to change applicationId and have your UNIQUE application ID
  2. run cd android > ./gradlew signInReport Scroll all the way up(!!!!) and copy the sha1 key of the debug varient
  3. open your browser with https://console.cloud.google.com/apis/credentials create android(!) credentials, VERY IMPORTANT: use the same applicationId from android/app/build.gradle and use the SHA1. save...

WE ARE NOT GOING TO USE THE ANDROID KEY BUT WITHOUT IT CapacitorGoogleAuth WILL NOT WORK.

in your app just use your web credentials (!!!)

Error 10 comes from Google API exception, and it signals that the android package name and sha1 are not valid

alon42 avatar Mar 29 '24 15:03 alon42

Thank you @alon42, this worked for me. To further clarify step 2 for the next person the SHA1 I needed was specifically the one under > Task :app:signingReport.

bobbyg603 avatar Apr 02 '24 18:04 bobbyg603

Thank you so much @alon42, It finally worked !

RobinRosculete avatar Apr 05 '24 20:04 RobinRosculete

I have done all of the above and even followed @agnusdei1207 's awesome instructions and still I get Something went wrong Error 10. Has anyone else found any other solutions?

kristophbarbour avatar Apr 18 '24 09:04 kristophbarbour

@kristophbarbour Error 10 comes from the Google API itself.

I was desperate enough to find its source code when I searched for this problem 3 weeks ago, and it comes from having bad Android credentials. when there is something wrong with your ApplicationId with the SHA1.

make sure you are using:

a. google WEB credentials in the Capacitor config. b. you created an android credentials WITHOUT using them. b1. Under Android credentials, you use a unique Application Id (I failed there) from android/app/build.gradle. b2. you are using the correct SHA from the output of cd android and then ./gradlew signInReport. b3. you wait enough time to let the cache in Google servers clear itself (they day 5 minutes).

alon42 avatar Apr 18 '24 10:04 alon42

Actually, i am also totally confused about google signing in ionic app but, i got to know solution by several tries, i finally discovered that the debug keystore SHA1 only works in the emulator

Here,

1.debug keystore SHA1 works only in emulator (to get debug keystore SHA1 in terminal enter this commands cd android and then ./gradlew signInReport)

  1. release keystore SHA1 works only in app.release.apk (to get release keystore SHA1 in terminal enter this commands keytool -keystore ./my-release-key.keystore -list -v ) (In commands this “./my-release-key.keystore” is path of production keystore path)

  2. In live playstore SHA1 works only in live app (Downloaded For playstore) (to get live playstore SHA1 Go to Play store Console and setup >> App signing (inside App signing you have App signing key certificate >>SHA-1 certificate fingerprint )

we should change SHA1 of Android SHA-1 signing certificate fingerprint. accordingly, in https://console.cloud.google.com (APIs & Services>>Credentials>>OAuth 2.0 Client IDs)

Please make sure clear app data and try 2 times while checking login functionality

Screenshot_20240507-155245

Raja-Malli-Dileep-Vadde avatar May 07 '24 10:05 Raja-Malli-Dileep-Vadde

I have done all of the above and even followed @agnusdei1207 's awesome instructions and still I get Something went wrong Error 10. Has anyone else found any other solutions?

Please check https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/332#issuecomment-2098010545

Raja-Malli-Dileep-Vadde avatar May 07 '24 12:05 Raja-Malli-Dileep-Vadde

Facing the same issue with error code 10 I have tried all the web client id, server client id, android client id and everything, replacing them with each other. Still the same error.

https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/332#issuecomment-2098010545

Raja-Malli-Dileep-Vadde avatar May 07 '24 12:05 Raja-Malli-Dileep-Vadde

error Error: Something went wrong at returnResult (VM3:912:32) at win.androidBridge.onmessage (VM3:887:21)

https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/332#issuecomment-2098010545

Raja-Malli-Dileep-Vadde avatar May 07 '24 12:05 Raja-Malli-Dileep-Vadde

Facing the same issue with error code 10 I have tried all the web client id, server client id, android client id and everything, replacing them with each other. Still the same error.

https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/332#issuecomment-2098010545

Raja-Malli-Dileep-Vadde avatar May 07 '24 12:05 Raja-Malli-Dileep-Vadde

I managed to use the GoogleAuth plugin on Android, but it only worked with the debug version (simulator or actual device), but the same build failed on the release version.

Using @Raja-Malli-Dileep-Vadde https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/332#issuecomment-2098269396, I FINALLY SUCCEEDED BY MANUALLY ADDING THE SHA-1 FROM GOOGLES PLAY-STORE AND ADD IT ONTO A NEW CREDENTIAL IN GCS (all without pushing a new version!).

Steps:

  1. Copy the "SHA-1 certificate fingerprint" from Google Play Console >> Setup >> App signing
  2. Manually add a new Android credential in the GCS Credential API with the SHA-1 fingerprint you just copied (I copied all the other fields from the old ones that I left untouched)
  3. Enjoy

Screenshot 2024-06-03 at 20 39 08

By the way, does this belong to the official instructions? @reslear @fullstackduck

Maybe it also relates https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/220, https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/110

arielhasidim avatar Jun 03 '24 17:06 arielhasidim

I have the same issue but I can't solve. My problem is for Android device only. iOS is ok

What about angular config and files:

Angular init: GoogleAuth.initialize({});

capacitor.config.ts

plugins: {
    CapacitorHttp: {
      enabled: true,
    },
    GoogleAuth: {
      scopes: ['profile', 'email'],
      iosClientId: "359711685XXX-653hlg3028afl02tbchp96XXXXXXX.apps.googleusercontent.com",
      androidClientId: "359711685XXXX-1eeonchhkt6k074ji3XXXXXXXX.apps.googleusercontent.com",
      forceCodeForRefreshToken: true,
    },
  }

google-services.json file into my ionic app into .\android\app\google-services.json

Please help me

lsantaniello avatar Jun 20 '24 09:06 lsantaniello

There are 2 SHA-1 code. What is the correct to copy?

image

lsantaniello avatar Jun 20 '24 10:06 lsantaniello

@lsantaniello

  1. Use the "App signing key certificate" and add it like the screenshot above
  2. In the capacitor.config.ts, you have a real ClientId without XXs, right?

arielhasidim avatar Jun 20 '24 15:06 arielhasidim

Yes, correct. I tried but not works :(

Are you available for premium support? If you can and you want help me, send me your private contact, please

lsantaniello avatar Jun 20 '24 15:06 lsantaniello

@lsantaniello Sorry, I'm just a struggling developer like you :|

arielhasidim avatar Jun 20 '24 15:06 arielhasidim

@lsantaniello Sorry, I'm just a struggling developer like you :|

if you want we can schedule a working session in order to solve the issue all together

lsantaniello avatar Jun 20 '24 17:06 lsantaniello

I was struggling with this error for hours!!! But then, while checking the demo and following the readme.md, I realized that I was missing a configuration in a file: android/app/src/main/res/values/strings.xml

In the demo, you can find it at: https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/master/demo/android/app/src/main/res/values/strings.xml

Once I added the with the Google clientId, everything started to work :)

Good day <3

I was developing a second version of my ionic/capacitor app. I wanted to start fresh, so created a new project and copied over all the necessary configs. However I was getting this code 10 error.

Finally the config mentioned above sorted it out. Weird, how the old project still worked.

Maybe because I switched the GoogleAuth plugin to a newer one.

I ran into code 10 when I was working on the first version, and went through all the SHA1 setup and all. And I ran into it the second time, but this time was totally different 🤷‍♂️

denesh-r avatar Jul 03 '24 12:07 denesh-r

I not solved!

lsantaniello avatar Jul 13 '24 11:07 lsantaniello