-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always showing 10:Something Went Wrong error - Ionic5 Capacitor4 Android #220
Comments
I have same problem, using version Any idea? |
It works if you do the next steps:
const config: CapacitorConfig = {
...,
plugins: {
GoogleAuth: {
scopes: ['profile', 'email'],
androidClientId: "YOUR_WEB_CLIENT_ID.apps.googleusercontent.com",
iosClientId: "YOUR_IOS_CLIENT_ID.apps.googleusercontent.com",
forceCodeForRefreshToken: true
},
},
}; The CLIENT_ID for ANDROID must be the WEB_CLIENT_ID otherwise it will not work Google Cloud Console/Credentials
Add your
Add <string name="server_client_id">YOUR_WEB_CLIENT_ID.apps.googleusercontent.com</string>
Import the plugin and use import com.codetrixstudio.capacitor.GoogleAuth.GoogleAuth;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
this.registerPlugin(GoogleAuth.class);
super.onCreate(savedInstanceState);
}
} This works for me! |
Maybe you´ll find that interesting: |
Hey @gilzonme, |
Did you find the cause? How did you get it working? |
Same for me... all those solutions don't work :( Cap 4 Ionic 6 |
Unable to find a Capacitor plugin to handle requestCode, trying Cordova plugins |
I got it running now by stepping back to a Capacitor 3 version of my code and the re-executed the Cap4 migration. Maybe there was a problem with Capacitor that got fixed in the last days, because I carefully tracked my code changes and didn't see anything that could've caused the GoogleAuth problems. Suspiciously, when GoogleAuth gave me that 10-error-code, my Facebook login didn't work as well. The Facebook login errored out because of a wrong hash. So I think that somehow with the Cap4 migration the hashing of security keys got broken and that caused the 10-error-code at GoogleAuth. |
@carsten-klaffke somehow the issue was solved... I kept all the same configs(recommended setup config as described by @CodeRevenge here... |
This is still the solution in Capacitor 4 |
On our side the underlying issue was that somehow the SHA1 of our app changed with capacitor 4 migration. We had to add the new fingerprint to the Android App settings in firebase console and then the login was working again. Reference: https://stackoverflow.com/questions/49450140/google-signin-api-exception-10 |
In addition to the WEB Client ID you MUST have the SHA-1 Android key in GCloud added in the OAuth credentials even though the Android client ID is never mentioned anywhere in the Capacitor Google Auth code. One other thing I ran into was that the key didn't transfer correctly from the changes in the capacitor.config.ts file to the android files. Make sure you run I only have the
All of them the web client ID value. |
Hello, @EugeneKruglei |
Same problem. Can someone suggest something else ? |
I managed to resolve this issue deleting the android app I previously created in the overview page of my project in firebase and creating it again with the app id, sha1 and app name. |
Apaparently there is an error between the debug.keytore and the release.keystore. When I add the debug.keystore in the google console (OAuth 2.0 Client IDs - Android Client) and I build the grandle with this in android studio, everything works. But when I add the release.keystore in the google console , it only works for the web and not for android or ios. What is going on? This is very weird. Can anyone help ? |
I also had problems, but the video helped me. For me, the problem was that an "Authorised JavaScript sources" was missing in the gcp console. |
We had the same issue. We fixed it by setting the androidClientId to the server_client_id value. Diffing 3.0.2 and 3.2.0 shows that the clientId was read from server_client_id and is now androidClientId. In 3.0.2:
became in 3.2.0
|
Facing Same error on Release build only. When building debug build on mobile and adding debug what exactly is the javascript origin? i have added default one |
@Saqib92 I think your issue is different. The behavior you get is expected, since Google Play generates a different SHA-1. |
where can i find it in Google Play? |
There are multiple ways, From Google Cloud Console: From the APK: |
looks like I already done almost same. |
Someone with the same error still? I have set client id for android the same as fo web but always code 10 error. Onl yandroid do not work. web and iOS is fine |
Why do I need to use firebase to fix this error, I tried everything so far.. nothing works still errors .. 10 |
I am using google auth in ionic ,sign in with google popup is opening but its throwing error |
Yes webview isn't supported in Auth anymore due to security, you can't handle the response from outside of the android unless you handle it somewhere else .. you'll have to handle the code inside androids Java.. |
In my case it was mismatch of |
Any reference on this? |
Had the same issue. |
If you are using Google Play Store App Signing, then the released version will use GOOGLE'S certificate SHA1 rather than the SHA1 from your release keystore. (Which makes sense when you think about it...) I encountered this when trying to release through google play, even though it was previously working on emulator in debug. You can find that SHA1 by going to MY_APP > Setup > App signing > App signing. Using that solved Edit: Also check out @LucaDaniele99's comment below! (I haven't gone back to check who is right yet 😅) |
@danny-hunt on Play Store I'm using Google App Signing but on GCloud I've inserted the SHA-1 keystore I use to sign the app in Android Studio so both of the SHA-1 works I think |
nop. continues to work. I'm using ionic 7 with capacitor and I've been getting error 10. I tried the previous solutions but discovered that my problem was a typo in the package name. ("strings.xml" file) So just to clarify. Do not use the gcp android client_id, but it is necessary to create it and make sure to use the corresponding debug/release. |
This error was showing for me up when I've been running app from Android Studio. I fixed it by adding OAuth Client ID (Android) in Google Cloud Console credential with SHA1 of my debug keystore ( cd android
./gradlew signingReport Also this video helped me to set everything up: https://www.youtube.com/watch?v=GwtpoWZ_78E |
Still not working, you send the app a couple of people and start showing the 'Something went wrong' msg |
It doesn't work in my project either. |
It is very simple: 2). When upload your app to playstore change your SHA-1. Copy it from google play console and paste it in google developer console where you created android client id. |
for anyone struggling with this. I'm 99% sure that
I think it deserves double checking but IMO this is how the docs should be updated to save tons of time people struggling with this. |
This is true. Thanks a lot! 👍 So in the https://console.cloud.google.com/apis/credentials You create two "OAuth 2.0 Client IDs". One with type "Web application" and one with type "Android". For the "Android" type set the right "Package name" and "SHA1 certificate fingerprint". In capacitor.config.json set the Client ID from the "Web Application" type:
Don't ask me why it works like this, it does 😊 |
I lost 1.5 days on this. I made it work finally by putting the web client id to the android id in my capacitor config:
|
My project doesn't have capacitor version: 5.6.0 |
thanks bro! you've saved my day :) |
Actually, i am also totally confused about google signing in ionic app but, i got to know solution by several tries for four months, i finally discovered that the debug keystore SHA1 only works in the emulator Here, |
Thanks mate @danny-hunt . This worked! |
For the record, this is the solution that works for me, even now, with Capacitor 6. The web client ID is required in all those locations, with the "App signing key certificate" SHA1 from the Google Play console registered as an Android "OAuth 2.0 Client IDs" in the Google Cloud Platform console. The Android client ID from the GCP console is not used anywhere. To enable Debug builds, simply create another Android Client Id in the GCP console and register the SHA1 you obtain from |
I am getting always 10:Something Went Wrong error while trying to login to google. Following are the steps I have done and my configurations/versions.
Configurations done in console :
Capacitor.config.ts :
What am I missing?
The text was updated successfully, but these errors were encountered: