Android FAQs
Generate Android key hash
With the help of OpenSSL tool
Download OpenSSL.
Configure OpenSSL environment variables.
Configure JDK to be able to use keytool.
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
After entering the key store, 28 characters are obtained as the target hash.
For Unity, the directory of the default Debug keystore isC:\Users\XXXXX\.android\debug.keystore
.Provide additional
debug.keystore
information.
Defaultdebug.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:
- Go to the console.
- cd to the keystore directory of the project.
- Enter the command:
keytool -list -v -keystore android.keystore
adroid.keystore
is the keystore of your APK. - Enter the keystore password.
In Android, Unity has a black screen issue on 12+(API 31+) systems.
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.
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)"
Update the Google version to V1.17 in the aar-imports
file in Unreal Engine.
Will including duplicate .so files in different AAR plugins affect the product volume?
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.