当我为我正在开发的应用程序手动安装 APK 时,我无法登录 Google Play 服务。屏幕上没有给出错误,但我知道它失败了,因为所有 Google Play 服务都不起作用,“已连接”属性为 false。
我使用 adb catlog 连接到正在运行的应用程序,并注意到这个似乎相关的错误:
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 服务。但是,现在我想测试应用内结算,我认为这需要我运行我上传到 Android 开发者控制台的签名 APK,所以我手动安装 APK。
要让我的独立应用连接到 Google Play,我需要做些什么特别的事情吗?是否有更好的方法在 Xamarin Studio 中测试应用内结算?
最佳答案
是不是因为签名 key 或包名在谷歌控制台没有权限?
您需要登录 Google Developer Console ,将 SHA1 添加到您的应用程序的 key 和程序包名称中。您可以获得的 SHA1
keytool -exportcert -alias androiddebugkey -keystore <path-to-debug-or-production-keystore> -list -v
Mac 和 Linux 上调试 keystore 的路径位于主目录中名为 .android
的隐藏目录中:~/.android/debug.keystore
和密码是 android
在 Windows 上,我猜它位于 %USERPROFILE%\.android\debug.keystore
,但我没有要验证的 Windows。
关于android - 无法登录手动安装的 APK 的 Google Play 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22238894/