Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google+ sign-in results in a "unknown error" - Google Play Game Services

I am trying to implement the Google Play Game Services and on the Main Menu of my app I have a Google+ sign-in button. When the user tries to login they get all the way through the login process (5+ screens) they get to the point where I think it is finalizing the login and then the below error pops up.

dsf

This is happening on my testers phones and I can reproduce it on my AVD emulator. The error obviously is kind of vague. I have tried all the solutions in link here to no success.

Can someone help me out? Not sure what code you need but I have posted relevant snippets of my MainMenu class below.

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)
    }
}

EDIT

What I've tried:

  • Making sure the SHA1/Certificate Fingerprint is correct

EDIT #2

Just noticed something. Do I need t click "Publish your game" in order for all of this to start working?

Also, do I need to export and upload the APK as a draft into the Dev Console first?

enter image description here

like image 938
Matt Avatar asked Jan 30 '26 05:01

Matt


1 Answers

Google Play does not auto-select a fingerprint. What you see in that window is an example fingerprint designed to communicate what a fingerprint looks like. You should find out your own fingerprint by using the keytool command, like this:

keytool -exportcert -alias your-key-name -keystore /path/to/your/keystore/file -list -v

If your key is a debug key, then your-key-name will typically be androiddebugkey.

like image 121
Bruno Oliveira Avatar answered Jan 31 '26 18:01

Bruno Oliveira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!