Skip to main content

Android FAQs

Generate Android key hash

With the help of OpenSSL tool

  1. Download OpenSSL.

  2. Configure OpenSSL environment variables.

  3. Configure JDK to be able to use keytool.

  4. Generate key hash.

    • To generate key hash on Mac, run the following command:
    keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
    • To generate key hash on Windows, run the following command:
    keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64
  5. After entering the key store, 28 characters are obtained as the target hash.
    For Unity, the directory of the default Debug keystore is C:\Users\XXXXX\.android\debug.keystore.

  6. Provide additional debug.keystore information.
    Default debug.keystore information is as follows:

    Keystore name: “debug.keystore”
    Keystore password: “android”
    Key alias: “androiddebugkey”
    Key password: “android”
    CN: “CN=Android Debug,O=Android,C=US”

Get SHA1 / MD5 values on Android

Use keytool to get SHA1

Keytool is a tool that comes with the JDK. Use keytool to get SHA1 with the following steps:

  1. Go to the console.
  2. cd to the keystore directory of the project.
  3. Enter the command: keytool -list -v -keystore android.keystore
    adroid.keystore is the keystore of your APK.
  4. Enter the keystore password.

In Android, Unity has a black screen issue on 12+(API 31+) systems.

Answer

This is a problem with Unity. Under Player Settings, click Mute Other Audio Sources to resolve the issue.

For more information, see Unity Forum Android 12 Telephony Crash, and Unity Documentation PlayerSettings.muteOtherAudioSources.

FAQs_Unity

Android startup crashed with error "java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Apiszzf at com.google.android.gms.games.Games,<clinit>(Unknown Source:0)"

Answer

Update the Google version to V1.17 in the aar-imports file in Unreal Engine.

FAQs_Unity

Will including duplicate .so files in different AAR plugins affect the product volume?

Answer

No. After upgrading Gradle in Player Network SDK V1.24.00, .so files are also included in the dependent AAR plugins, such as INTLCore.so being included in the INTLUnityAdapter.aar plugin. In order to not affect the product volume, pickFirst has been defined in the gradle file, to avoid having duplicate .so files in the final APK product.

For Player Network SDK V1.24.01, duplicate .so files have been removed the AAR plugins.