• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android 【Solved by hand】JDK not installed correctly at location entered in Android Platform settings

Zhanghua

Member
JDK not installed correctly at location entered in Android Platform settings.

When generate the Key in preference:
WARNING: can't open config file: ${runtimeLocation}\bin\openssl.cnf

And build the APK error:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.ide.common.signing.KeytoolException: Failed to read key default_alias from store "D:\ASDF.keystore": Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.


keytool error: java.lang.Exception: Only one command is allowed: both -exportcert and -list were specified.



Any body give me some tips, TKU!
 
Last edited:

Zhanghua

Member
Newest error log.

WARNING: can't open config file: ${runtimeLocation}\bin\openssl.cnf
elapsed time 00:00:00.0519924s for command "C:\ProgramData/GameMakerStudio2-Beta/Cache/runtimes\runtime-23.1.1.290\bin/openssl.exe" base64 -in "D:\GMS2_BETA\data\1\GMS2TEMP\keysha" started at 06/04/2021 09:56:47
"D:\JDK\bin/keytool.exe" -exportcert -keystore "D:\qweasdf.keystore" -alias "qweasdf" -storepass "qweasdf" -list -v

Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
keytool error: java.lang.Exception: Only one command is allowed: both -exportcert and -list were specified.
elapsed time 00:00:00.1704773s for command "D:\JDK\bin/keytool.exe" -exportcert -keystore "D:\qweasdf.keystore" -alias "qweasdf" -storepass "qweasdf" -list -v started at 06/04/2021 09:56:47



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':com.company.game:packageRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.ide.common.signing.KeytoolException: Failed to read key aha from store "D:\project_name.keystore": Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
 
Last edited:

Zhanghua

Member
I have to use the keytool by hand........to generate the keystore file now......
Such as:
keytool -genkey -alias ccc -keypass 123456 -keyalg RSA -keysize 1024 -validity 365 -keystore D:/ccc.keystore -storepass 123456
 
Newest error log.

WARNING: can't open config file: ${runtimeLocation}\bin\openssl.cnf
elapsed time 00:00:00.0519924s for command "C:\ProgramData/GameMakerStudio2-Beta/Cache/runtimes\runtime-23.1.1.290\bin/openssl.exe" base64 -in "D:\GMS2_BETA\data\1\GMS2TEMP\keysha" started at 06/04/2021 09:56:47
"D:\JDK\bin/keytool.exe" -exportcert -keystore "D:\qweasdf.keystore" -alias "qweasdf" -storepass "qweasdf" -list -v

Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
keytool error: java.lang.Exception: Only one command is allowed: both -exportcert and -list were specified.
elapsed time 00:00:00.1704773s for command "D:\JDK\bin/keytool.exe" -exportcert -keystore "D:\qweasdf.keystore" -alias "qweasdf" -storepass "qweasdf" -list -v started at 06/04/2021 09:56:47



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':com.company.game:packageRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.ide.common.signing.KeytoolException: Failed to read key aha from store "D:\project_name.keystore": Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
I'm getting the same issue and can't seem to fix it. It's like the "-list" or - exportcert should be there but game maker is doing both of them. I have no idea how to fix it
 
I have to use the keytool by hand........to generate the keystore file now......
Such as:
keytool -genkey -alias ccc -keypass 123456 -keyalg RSA -keysize 1024 -validity 365 -keystore D:/ccc.keystore -storepass 123456
So i ignored the error and just ran the project anyway and it seems to work. I also went back into the settings to and clicked showhash and it showed up even though the error came up again. Even with the error the keystore is created so i'm just gonna continue to ingore the error
 

Zhanghua

Member
So i ignored the error and just ran the project anyway and it seems to work. I also went back into the settings to and clicked showhash and it showed up even though the error came up again. Even with the error the keystore is created so i'm just gonna continue to ingore the error
The newest beta catch the issue.
 

EAtkin

Member
Hey everyone, I was smashing my head against a wall with this issue last night. Messed around with it this morning then read on the Gamemaker Required SDKs post:
The new Android Studio 4.2 ships with OpenJDK 11 rather than 8, as 4.1 used. This has been found to cause issues with importing/generating keystore files and therefore can cause Create Exe to fail. We have fixed this already for GMS 2.3.3 Betas, but for all current GMS2 stable releases you need Android Studio 4.1 anyway (as we documented below).
I uninstalled Android Studio 4.2, installed 4.1 and it worked straight away. Wish I had read that last night!
 
The newest version had resolved this issue, u can useAS4.2+ now
still getting this error
Task :com.StudentGaming.TestGame:packageRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':com.StudentGaming.TestGame:packageRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.ide.common.signing.KeytoolException: Failed to read key Edson from store "C:\Users\USER\Documents\GameMakerStudio2\company.keystore": Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
 

Zhanghua

Member
still getting this error
Task :com.StudentGaming.TestGame:packageRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':com.StudentGaming.TestGame:packageRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.ide.common.signing.KeytoolException: Failed to read key Edson from store "C:\Users\USER\Documents\GameMakerStudio2\company.keystore": Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
use the newest version of gms and AS.
make sure the jdk is open jdk while not oracle one.
 
Top