'Errors while building APK: Algorithm HmacPBESHA256 not available
I am trying to update an existing Android app, but while generating a Signed APK the following error message appears: Algorithm HmacPBESHA256 not available
I have searched the internet for a solution, including here on StackOverflow, but I cannot find one anywhere. I know that the current keystore uses SHA1withRSA, but how to convert it to HmacPBESHA256 I would not know. Google Play support unfortunately can't help me either, as this question is too technical.
For the sake of clarity here is the full notification:
Execution failed for task ':app:packageRelease'. A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable com.android.ide.common.signing.KeytoolException: Failed to read key 1 from store "/Users/KDApps/Documents/KDApps/original-signing-keystore.jks": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available
Solution 1:[1]
Make sure JDK is installed.
File -> Project Structure -> SDK Location -> Gradle Settings -> change the gradle JDK to the correct one.
Solution 2:[2]
The problem occurs due to Missing Java Environment variable or mismatch between Android jdk and already set java environment variable version. To solve this set jdk to environment variable version.
Solution 3:[3]
i also experienced the same thing, but when i change JDK to 16 it managed to debugenter image description here
and it worked when changing my jdk
Solution 4:[4]
I've tried a lot of things following different SO answers, but here's what worked for me at the end
I removed the JDK v11 I had initially (because from what I've read, 11 doesn't have the encryption algorithm), installed v16, then updated the JAVA version that gradle uses by going to:
Preferences > Build, Execution and Deployment > Build Tools > Gradle
then selecting Gradle SDK to v16
Solution 5:[5]
Android Studio
1st :
Upgrade your Gradle Plugin Version
In order to do this you must get a gradle version downloaded.
You can get version 7.0.2 https://downloads.gradle-dn.com/distributions/gradle-7.0.2-bin.zip
then upgrade after in android studio.
You should get a popup notification to complete a gradle upgrade when
you open android studio again.
RESTART ANDROID STUDIO
2nd :
Inside project root open,
"file" -> "settings" -> "build, execution, deployment" -> "build tools" -> "gradle"
Then update the Gradle user home
to your newly downloaded gradle location.
In my case I saved my download here - C:/Program Files/Android/gradle-7.0.2
RESTART ANDROID STUDIO
Solution 6:[6]
I solved this problem by entering "File" -> "Settings" -> "Build, Execution, Deployment" -> "Build Tools" -> "Gradle" and selected appropriate "Gradle JDK" version.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | James Barboza |
| Solution 2 | Vidyesh Churi |
| Solution 3 | Kusuma |
| Solution 4 | Dillion |
| Solution 5 | |
| Solution 6 | ouflak |
