我正在拼命尝试设置Android游戏以使用Google Play游戏服务SDK。
在关注official documentation后,我的代码基于this example。在日志中调用登录会导致此错误:
01-31 12:06:54.580: E/Volley(1853): [6153] qt.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/110100128023441368674
01-31 12:06:54.612: E/SignInIntentService(1853): Access Not Configured. Please use Google Developers Console to activate the API for your project.
唉,我的项目的API存在于API控制台(https://cloud.google.com/console/project)中,它包含我的证书的正确SHA1足迹,并且在我在Android Dev Console中注册我的项目时自动创建了它(https://play.google.com/apps/publish)。
我已经检查了SO问题here中的建议,但没有用...
我不知道它是否相关,但我有一个奇怪的错误,条款和条件接受弹出窗口偶尔会再次出现(即使在完整的浏览器缓存清理后),就像它没有注册我的接受或其他东西。
作为参考,这是我的Android清单(我确保@string/app_id
与开发者控制台(147029020397)中的App ID匹配,并且sdk版本包含在元数据中):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pokware.jb"
android:versionCode="2"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:debuggable="false">
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
<activity
android:name="com.pokware.jb.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
答案 0 :(得分:4)
所以,经过几十次尝试,我终于成功了。
我的设置没有错误,但我怀疑我之前的许多失败尝试都在手机的应用程序缓存中引入了错误的数据。
我清除了Google Play服务应用的缓存(在设置android系统菜单中),手动安装了我的生产APK(而不是运行在eclipse中使用调试证书签名的开发版),运行一次,然后启动Eclipse内部的dev版本(覆盖手动安装的prod应用程序)。然后出现了神奇的“欢迎”弹出窗口!