Error 10 - ionic 3(Cordova) cordova-plugin-googlep

2019-08-26 06:23发布

I followed all the steps to publish apk on play store. But getting error 10 after installing from play store. But When I install released apk from my computer to android mobile it is working fine.

Steps followed to create apk -

Step 1: Created build release ionic Cordova project using below command -

ionic cordova build android --prod --release

After this i got unsigned apk("../../platforms/android/build/outputs/android-release-unsigned.apk").

Step 2: I signed the apk using java keytool command -

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../../release-key.keystore ../../platforms/android/build/outputs/android-release-unsigned.apk keystore-alias

Step 3: Also verified the signature by using java tool -

jarsigner -verify -verbose -certs ../../platforms/android/build/outputs/android-release-unsigned.apk

Got a messag in command window "Signature verified".

Step 4: Then used zipalign tool of "Android SDK" to align/optimize the apk, command is as below -

        zipalign -v 4 ../../platforms/android/build/outputs/android-release-unsigned.apk ../../platforms/android/build/outputs/ToDo.apk

Step 5: Published the apk to "https://play.google.com".

After Some couple of hours published apk was listed on Google PlayStore. I installed it from Google PlayStore on my android mobile and getting error 10.

Steps followed to get SHA-1 Key -

Step 1: Keystore file is created using java keytool command -

keytool -genkey -v -keystore ../release-HMC.keystore -alias release-key -keyalg RSA -keysize 2048 -validity 10000

Step 2: Got SHA-1 Key by using below command -

keytool -list -v -keystore ../release-HMC.keystore -alias release-key

Step 3: Enabled the Google Sign-in from "https://developers.google.com/mobile/add?platform=android&cntapi=signin"

And I also enabled "Google+ API" on Google Console("https://console.developers.google.com/apis/").

What i did wrong please Help !

2条回答
再贱就再见
2楼-- · 2019-08-26 07:09

I found a possible solution in the following way. When I'm in the process of generating my SHA-1 key:

keytool -exportcert -list -v -alias androiddebugkey -keystore ~ ​​/ This part has to point where your apk is

example my apk is in platform / android / build / output / apk / apk-debug.apk then it would be

keytool -exportcert -list -v -alias androiddebugkey -keystore ~ ​​/ platform / android / build / output / apk / apk-debug.apk

This will generate a correct application key to do a better process I recommend the following this article

查看更多
疯言疯语
3楼-- · 2019-08-26 07:11

The problem was that the google play app signing was selected by default when we publish.

1. Open Google Play Console(https://play.google.com/apps) and log in with your credentials then select your android app.

2. Goto Your App management.

3. Goto "Release Management" menu and select "App Signing"

4. In "App Signing" you will see the "App Signing Certificate" Panel Copy "SHA-1 certificate fingerprint".

5. Goto "https://developers.google.com/mobile/add?platform=android&cntapi=signin" to create the Android mobile project.

Note: In "Step 5" create project form asks you to select project so, for this you need to create project first on " https://console.developers.google.cm/".

6. Create the Android mobile project from "step 5". In above step, it asks for "SHA-1 key"(paste SHA-1 certificate fingerprint which you get from Google Play Console) to create the project.

7. After "step 5" and "step 6" Google automatically creates the "OAuth Client" and API key for you in your "https://console.developers.google.com/" project.

8. To access your Google API services get OAuth and API Key for your android project from "htts://console.developers.google.com/"

enter image description here

For more information see the link - "http://www.jomendez.com/2017/08/30/ionic-2-google-sign-in-error-10-with-firebase/"

查看更多
登录 后发表回答