Search code examples
androidgoogle-plus-signin

Google Plus Login Internal Server Error After creating a signed Release apk


I have this weird Issue that When I connect my Device via USB and Run the app in my Device it is working properly and I was able to sign into google plus.

when I generate a signed apk release file and copy that and paste it in my device , after Installation when I try to Login it says Internal server Occured.

PS

I have filled the consent Screen in the developer console , I have entered my androiddebugkey in the Credentials of the Developer Console as well .

What I am doing wrong ?


Solution

  • Generate Base64 key and sign with package name. submit in Developer console. after complete process you will sign with google.

      private void generateHashKey() {
    
            try {
                PackageInfo info = getPackageManager().getPackageInfo                       ("loginwith.gplush.android", PackageManager.GET_SIGNATURES);
                for (Signature signature : info.signatures) {
                    MessageDigest md = MessageDigest.getInstance("SHA");
                    md.update(signature.toByteArray());
                    String hashCode  = Base64.encodeToString(md.digest(), Base64.DEFAULT);
                    System.out.println("Print the hashKey for Facebook :"+hashCode);
                    Log.d("KeyHash:", Base64.encodeToString(md.digest(),          Base64.DEFAULT));
                }
            } catch (NameNotFoundException e) {
    
            } catch (NoSuchAlgorithmException e) {
    
            }
        }