12501错误:离子什么keystore是与应用程序建设 [英] 12501 error: Ionic what keystore is the app building with
问题描述
我正在使用 Ionic 2
和
但是当我尝试登录时,得到: error = 12501
$ b
我明白了,对于 Android
,我们需要把 SHA1
放在这里:
,特别是 Android设置
,但我认为这已经过时了。但是他们会这样说:
$ b
如果你得到Error 12501 - User Cancelled,这意味着你使用了错误的
Bundle ID在您的iOS / Android配置步骤。确保你
正在使用正确的,通过在
config.xml中设置你想要的Bundle ID,并在设备设置过程中使用该ID
从上图可以看出, Package name
匹配 Bundle ID $ c $
config.xml
。
<?xml version = '1.0'encoding ='utf-8'?>
< widget id =com.ionicframework.thewhozooXXXXversion =0.0.1xmlns =http://www.w3.org/ns/widgetsxmlns:cdv =http:// cordova .apache.org / NS / 1.0\" >
解决方案
您需要为Android安装 Web客户端ID
而不是 Android客户端ID
!)。这对我有效。
code:
GooglePlus.login({
'webClientId':'XXXXXX.apps.googleusercontent.com',
'offline':true
))。then(googleData => {
但是不明白的是,对于 iOS
它与 iOS客户端id
一起工作,所以没有一致性。 p>
UPDATE
$ b 这似乎适用于 code>使用
Web客户端
如果您查看返回值 googleData
:
googleData.providerData [0] .displayName
googleData.providerData [0] .photoUrl
I am using Ionic 2
with GooglePlus Authentication. Everything works perfectly for iOS
. For Android
I build my app as follows:
ionic build android
For the Android
build, I need a SHA1
keystore for Google Authentication.
I have a Macintosh HD/Users/myname/.android/debug.keystore
, so according to these instructions, I generate a keystore using (default password 'android
'):
keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
The output looks correct. I use this SHA1
to for my Android Credentials
as per the above instructions:
But when I try login, I get: error = 12501
From here I believe it's related to not having the SHA1
in the Google Credentials matching the SHA1
for the Android build of the app.
Question
What SHA1
is my Android
build using? How do I check if it matches the one generated above for the credentials?
UPDATE
From reading the following:
I understand it, that for Android
, we need to put the SHA1
here:
However, after trying this, I still get the 12501
error.
UPDATE
I have also tried following these instructions, specifically the Android Setup
, but I think it's outdated. But they do say the following:
If you get Error 12501 - User Cancelled, this means you used the wrong Bundle ID during your iOS/Android configuration steps. Make sure you are using the correct one, by setting your desired Bundle ID in your config.xml, and using that ID during the Device Setup
As you can see from the image above, the Package name
matches the Bundle ID
in config.xml
.
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.thewhozooXXXX" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
SOLUTION
You need to use a Web Client ID
and not an Android Client ID
for Android (Go Figure!). This worked for me.
code:
GooglePlus.login({
'webClientId':'XXXXXX.apps.googleusercontent.com',
'offline': true
}).then(googleData => {
What I do not understand however, is that for iOS
it works with the iOS Client id
. So there's no consistency.
UPDATE
This seems to work for Android
using the Web client
. If you look at the return value googleData
:
googleData.providerData[0].displayName
googleData.providerData[0].photoUrl
这篇关于12501错误:离子什么keystore是与应用程序建设的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!