Skip to main content

Use an APK to test Google login

Based on Google Play App Signing, upload the AAB package to the Google Play console and download it through the generated link before logging in normally.

Google Internal App Sharing

If directly using the APK to test Google login, it will return a login error message with error code 9999 and third-party error code 10.

Solutions

caution

The following method is only used for local APK testing. After releasing the app to Google Play, change the SHA-1 certificate fingerprint back to its initial configuration. Otherwise, login will fail after release.

  1. Extract SHA-1 certificate fingerprint. There are two SHA1 extraction methods. Select one based on needs.

    a. Extract SHA-1 from keystore certificate.

    keytool -keystore path-to-debug-or-production-keystore -list -v

    b. Extract SHA-1 from APK: Unpack the APK, get the RSA file (generally named as CERT.RSA), and run the command below to get SHA-1.

    keytool -printcert -file path-to-RSA-file
  2. Update the Android client SHA-1 certificate fingerprint configuration in the Google API developer platform and save the changes.

    Google_API_SHA1

  3. Use the APK to test Google login.