0

当我手动安装我正在工作的应用程序的APK时,我无法登录到Google Play服务。在屏幕上没有出现错误,但我知道这是失败的,因为没有Google Play服务工作,“连接”属性是错误的。无法登录到谷歌播放服务手动安装的APK

我连接到具有ADB目录下载正在运行的应用程序,并注意到了这个错误,这似乎相关:

E/SignInIntentService(1266): Access Not Configured. Please use Google Developer 
s Console to activate the API for your project. 
E/SignInIntentService(1266): dix 
E/SignInIntentService(1266): at dec.a(SourceFile:151) 
E/SignInIntentService(1266): at cqe.a(SourceFile:331) 
E/SignInIntentService(1266): at cqe.a(SourceFile:312) 
E/SignInIntentService(1266): at cph.a(SourceFile:634) 
E/SignInIntentService(1266): at djo.a(SourceFile:250) 
E/SignInIntentService(1266): at com.google.android.gms.games.service.GamesSig 
nInIntentService.onHandleIntent(SourceFile:389) 
E/SignInIntentService(1266): at android.app.IntentService$ServiceHandler.hand 
leMessage(IntentService.java:65) 
E/SignInIntentService(1266): at android.os.Handler.dispatchMessage(Handler.ja 
va:99) 
E/SignInIntentService(1266): at android.os.Looper.loop(Looper.java:137) 
E/SignInIntentService(1266): at android.os.HandlerThread.run(HandlerThread.ja 
va:61) 
E/LoadSelfFragment(16340): Unable to sign in - application does not have a regis 
tered client ID 
W/SignInActivity(16340): onSignInFailed()... 
W/SignInActivity(16340): ==> Returning non-OK result: 10004 

完整的日志可以在这里找到:http://pastebin.com/KDFbJ4un

当我运行从Xamarin的应用Studio,我可以毫无问题地登录Google Play服务。不过,现在我想测试应用内结算,我相信我需要运行已签名的APK,因此我上传了Android开发者控制台,因此我正在手动安装APK。

为了让我的独立应用连接到Google Play,我需要做些特别的事情吗?有没有更好的方法来测试Xamarin Studio中的应用内结算?

回答

0

我一直在为此乱搞一整天,最后才开始工作。我尝试很多不同的东西,所以我不是100%肯定有什么固定的问题,但我认为这是它干了什么:

添加以下到我的Android清单文件:

<uses-permission android:name="com.android.vending.INTERACT_ACROSS_USERS_FULL" /> 

我这样做是因为我注意到我这个logcat中其他错误:

W/ActivityManager(465):权限拒绝:获取/设置设置用户 要求茹n的用户-2,而是从用户0调用;这需要 android.permission.INTERACT_ACROSS_USERS_FULL

我觉得这开始发生,因为我已经添加了多个谷歌+用户到我的手机(测试应用内购买)。

1

是不是因为签名密钥或包名称在Google Console中没有权限?

您需要登录到Google Developer Console,将SHA1添加到您的应用的密钥和包名称。该SHA1你可以用

keytool -exportcert -alias androiddebugkey -keystore <path-to-debug-or-production-keystore> -list -v 

在Mac和Linux上的调试密钥库是在一个隐藏目录中的主目录称为.android路径获得:~/.android/debug.keystore,密码为android 在Windows上,我想这是在%USERPROFILE%\.android\debug.keystore ,但我没有一个Windows来验证。

+0

我已经做到了(我相信)正确。我认为这可以通过以下事实得到证实:当我运行Xamarin Studio_的应用程序时,我可以毫无问题地登录Google Play服务。只有当我运行手动安装的APK版本时,它无法连接。 – Goose

+0

我想象着Xamarin是否使用了不同的密钥,并且已经为该密钥提供了访问权限,但似乎并非如此。 –

+0

你实际上是正确的。由于上传到Google的APK使用私钥库,因此我必须添加一个额外的OAuth项(使用该私钥库)。但是,即使这样做,问题仍然存在。 – Goose