我正在尝试在Google Play Game Services
我的应用程序的主菜单上实现和,我有一个 Google+ 登录按钮。当用户尝试登录时,他们会一直完成登录过程(超过 5 个屏幕),他们会到达我认为正在完成登录的地步,然后弹出以下错误。
这发生在我的测试手机上,我可以在我的 AVD 模拟器上重现它。这个错误显然有点模糊。我已经尝试了此处链接中的所有解决方案,但均未成功。
有人可以帮我吗?不确定您需要什么代码,但我在MainMenu
下面发布了我的课程的相关片段。
MainMenu.class
public class MainMenu extends BaseGameActivity {
DatabaseHelper dh;
ImageView image;
Button startBtn, highscoresBtn, aboutBtn, comingsoonBtn, biblestudyBtn, signOut;
SignInButton sign_in_button;
TextView title, subtitle;
public static final String notice = "notice";
GamesClient client;
Context c;
@Override
public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.mainmenu);
client = getGamesClient();
client.connect();
c = this;
sign_in_button = (SignInButton)findViewById(R.id.sign_in_button);
signOut = (Button)findViewById(R.id.sign_out_button);
startBtn = (Button)findViewById(R.id.startBtn);
highscoresBtn = (Button)findViewById(R.id.highscoresBtn);
aboutBtn = (Button)findViewById(R.id.aboutBtn);
comingsoonBtn = (Button)findViewById(R.id.comingsoonBtn);
biblestudyBtn = (Button)findViewById(R.id.biblestudyBtn);
title = (TextView)findViewById(R.id.title);
subtitle = (TextView)findViewById(R.id.subtitle);
startBtn.setText(c.getResources().getString(R.string.startBtn));
highscoresBtn.setText(c.getResources().getString(R.string.highscoresBtn));
aboutBtn.setText(c.getResources().getString(R.string.aboutBtn));
comingsoonBtn.setText(c.getResources().getString(R.string.comingsoonBtn));
biblestudyBtn.setText(c.getResources().getString(R.string.biblestudyBtn));
title.setText(c.getResources().getString(R.string.title));
subtitle.setText(c.getResources().getString(R.string.subtitle));
//sign_in_button.setText(c.getResources().getString(R.string.signin));
signOut.setText(c.getResources().getString(R.string.signout));
sign_in_button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// start the asynchronous sign-in flow
beginUserInitiatedSignIn();
}
});
signOut.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// sign-out
signOut();
// show sign-in button, hide the sign-out button
findViewById(R.id.sign_in_button).setVisibility(View.VISIBLE);
findViewById(R.id.sign_out_button).setVisibility(View.GONE);
}
});
}
public void onSignInSucceeded() {
// show sign-out button, hide the sign-in button
findViewById(R.id.sign_in_button).setVisibility(View.GONE);
findViewById(R.id.sign_out_button).setVisibility(View.VISIBLE);
final Dialog dialog = new Dialog(c);
dialog.setContentView(R.layout.importlayout);
dialog.setTitle(R.string.importtitle);
TextView question = (TextView)dialog.findViewById(R.id.question);
Button save = (Button)dialog.findViewById(R.id.save);
Button scratch = (Button)dialog.findViewById(R.id.scratch);
question.setText(c.getResources().getString(R.string.importquestion));
save.setText(c.getResources().getString(R.string.savebtn));
scratch.setText(c.getResources().getString(R.string.scratchbtn));
save.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
//...
}
});
scratch.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dh.deleteAll();
for(int i = 0; i < 15; i++) {
dh.insert(0, 0, "-");
}
dialog.dismiss();
dh.closeDB();
}
});
dialog.show();
}
public void onSignInFailed() {
// sign in has failed. So show the user the sign-in button.
findViewById(R.id.sign_in_button).setVisibility(View.VISIBLE);
findViewById(R.id.sign_out_button).setVisibility(View.GONE);
// (add any code if needed)
}
}
编辑
我试过的:
- 确保 SHA1/证书指纹正确
编辑#2
刚刚注意到一件事。我是否需要单击“发布您的游戏”才能让所有这些开始工作?
另外,我需要先将 APK 作为草稿导出并上传到开发控制台吗?