cordova-plugin-googleplus icon indicating copy to clipboard operation
cordova-plugin-googleplus copied to clipboard

Error 10, but cert is correct

Open tbabich opened this issue 7 years ago • 30 comments

getting error 10 on login

getSigningCertificateFingerprint returns the same finderprint that in console building with build.phonegap.com

Google console android section (in config.xml set android-packageName="com.thailandpavillion.android") onpaste 20170628-141109

getSigningCertificateFingerprint screenshot onpaste 20170628-141323

Google console web section onpaste 20170628-141234

code screenshot onpaste 20170628-141430

tbabich avatar Jun 28 '17 11:06 tbabich

Does anyone have a fix for this?

thijssmudde avatar Jul 01 '17 11:07 thijssmudde

I also started thread at Adobe forums - https://forums.adobe.com/thread/2352379

tbabich avatar Jul 02 '17 08:07 tbabich

guys, any ideas?

tbabich avatar Jul 10 '17 16:07 tbabich

I have the same error. If I see the Android Studio console, I have the error:

You have wrong OAuth2 related configurations, please check. Detailed error: INVALID_AUDIENCE

Can anybody help me?

sergiomedinavalentin avatar Jul 12 '17 08:07 sergiomedinavalentin

+1

speedfl avatar Jul 24 '17 12:07 speedfl

Same error in ionic 3 app

catch return error 10 only

image

@EddyVerbruggen please help us

fredroo avatar Jul 29 '17 01:07 fredroo

I found the issue for me. Ensure that in firebase console you authorized google login and paste your sha key inside for both dev (unsagnied) and prod apk (signed)

speedfl avatar Jul 29 '17 07:07 speedfl

Solution taken from here: https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/243#issuecomment-245908012

For Debug, before signing/to test your app locally

keytool -exportcert -keystore ~/.android/debug.keystore -list -v
password: android

For production you have a different SHA1 code. I had an already published app in the play store, but didnt know what SHA1 code it was using. Solution was to sign with a different keystore and upload it to the releases page. The playstore will tell you exactly what is the correct SHA1 key used to sign the release apk. I know its weird to do it like this, but it worked.

If someone knows how to directly get the SHA1 for the release key, please fill me in.

thijssmudde avatar Jul 29 '17 10:07 thijssmudde

Once you have any apk (even prod) You can launch this command keytool -list -printcert -jarfile <your apk>

speedfl avatar Jul 29 '17 10:07 speedfl

I've faced same issue. And fixed it with proper cert signing. SHA-1 fingerprint of this cert should be defined in Google APIs console.

Hint: you may force Cordova (in fact gradle) to build dev apk with same production certificate: cordova run android --device -- --keystore=./path_to_keysore/keystore.jks --storePassword=****** --password=****** --alias=your_alias

aborovsky avatar Jul 30 '17 22:07 aborovsky

it seems google now resigns the apk's , i fixed it by creating extra credentials with the SHA1 found under: App Signing in the play developer console.

jeroen79 avatar Aug 08 '17 17:08 jeroen79

@jeroen79 could you explain a little bit more on how you got things to work? I found the app signing section of android developer console, but haven't figured out how to properly export my key, or if I even have to?

mackbrowne avatar Aug 12 '17 14:08 mackbrowne

@tbabich were you able to solve your issue?

amit777 avatar Aug 13 '17 00:08 amit777

look at the screenshot, the bottom one is the one i signed my app with, but the top one is the one google signed the app with it published in the store.

signing

jeroen79 avatar Aug 13 '17 06:08 jeroen79

@amit777 I've solved this by generating app for Android by cocoon.js

tbabich avatar Aug 19 '17 08:08 tbabich

@jeroen79 Thanks! take SHA-1 from app signing - solved my issue

Dan890 avatar Aug 22 '17 07:08 Dan890

http://cheonbrave.blogspot.kr/2017/10/android-cordova-plugin-googleplus-10.html

cheonbrave avatar Oct 04 '17 10:10 cheonbrave

@aborovsky Thanks! Signing my APK when running debug - Solved my issue

m4drick avatar Nov 23 '17 02:11 m4drick

My Problem 'Error: 10' is solved. @speedfl thanks, dude.

Riyaz0001 avatar May 23 '18 19:05 Riyaz0001

I have been stuck with error 10 (DEVELOPER_ERROR), because I was using the Android client ID, I created in the google developer console. The solution for me was to use the Android credentials in google developer console only to indicate the SHA key of my apk and to use the client ID of the Web application credentials from the google developer console in my cordova application.

config.xml:

    <plugin name="cordova-plugin-googleplus" spec="^5.3.0">
        <variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps.[web-application-client-id]" />
        <variable name="WEB_APPLICATION_CLIENT_ID" value="[web-application-client-id].apps.googleusercontent.com" />
    </plugin>

code: window.plugins.googleplus.login( { 'webClientId': '[web-application-client-id].apps.googleusercontent.com' }, ...

I don't use firebase.

tkohr avatar May 31 '18 08:05 tkohr

Mi problema 'Error: 10' está resuelto. @speedfl gracias, amigo.

AndreyMartinez avatar Jun 28 '18 13:06 AndreyMartinez

Thanks @speedfl ! It worked for me.

andreybleme avatar Jul 10 '18 14:07 andreybleme

I'm facing similar issue, it's working great with our debug key and dev credentials but when I use the prod one I'm facing error 10... SHA1 is set correctly, widget id matchs the package name, WEB_APPLICATION_CLIENT_ID is correct (not the android app one) any thought ?

rcauquil avatar Feb 06 '19 16:02 rcauquil

I'm so dumb... I forgot I hardcoded our DEV client_id so when I used our production app the SHA couldn't match...

rcauquil avatar Feb 07 '19 17:02 rcauquil

Same problem i am facing. My SHA-1 key is correct but it still gives the error 10.

yachikajoshi avatar Jun 03 '19 10:06 yachikajoshi

i m also getting the same error.....

anjalii11 avatar Aug 13 '19 06:08 anjalii11

Once you have any apk (even prod) You can launch this command keytool -list -printcert -jarfile <your apk>

thank you

rojasjuniore avatar Nov 12 '19 16:11 rojasjuniore

Same problem i am facing. My SHA-1 key is correct but it still gives the error 10.

Validate your WIDGET ID in the config.xml, its the package name of Firebase.

<widget id="xxx.xxxxx.xxxxx" ....

juhand777 avatar Feb 21 '20 16:02 juhand777

This is how I solved it in my case.

  1. Generated APK once by running the following command in my project root directory: C:\myApp>ionic cordova build android --prod

  2. Ran this command in the location of my APK file within my project, at command line: C:\myApp\platforms\android\app\build\outputs\apk\debug> keytool -list -printcert -jarfile app-debug.apk The above command gave me bunch of Certificate Fingerprints, out of which I copied the one that said: SHA1: 7B:6B:AD:...

  3. Visited: Firebase Console and selected the project.

  4. Edited Project Settings. A new page loaded with many tabs. Under the General tab, there is a section called "Your apps". Underneath that, my app was listed as I have already added it previously. For this app, I clicked on the blue hyperlink that says "Add fingerprint". Then pasted the copied Fingerprint that was copied in Step 2 above and saved it.

  5. Verified if the Certificate was added correctly by visiting: Cloud Console . It appeared under the heading "OAuth 2.0 Client IDs" as "Android client for com.mydomain.myapp (auto created by Google Service)". Clicked the Edit button and that showed me the complete SHA-1 fingerprint that I added.

  6. Ran the build and tested and it worked. It wasn't showing the Error 10 any more and in fact, it was returning back the Profile info as I expected!

Hope it helps!

devner007 avatar Feb 28 '20 03:02 devner007

@juhand777 solution worked for me. Even though I manually changed the widget id in config.xml ionic overwrote it. So I changed all occurrences of io.ionic.starter to correct package name over the project and this fixed the Google login.

Other things needed to be done as well, like making sure the correct SHA-1 is added to firebase.

hpeinar avatar Apr 15 '20 12:04 hpeinar