Errors while building APK: Algorithm HmacPBESHA256 not available

17.9k Views Asked by At

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

7

There are 7 best solutions below

0
On

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

enter image description here

0
On

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

1
On

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.

0
On

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

0
On

It seems to be an issue with different JDK versions as most people have pointed out. I had a similar issue. I encountered the issue with JDK 8, tried different flavours(Oracle, Adopt...) but finally worked when I upgraded the version to JDK 14.

1
On

I solved this problem by entering "File" -> "Settings" -> "Build, Execution, Deployment" -> "Build Tools" -> "Gradle" and selected appropriate "Gradle JDK" version.

0
On

Make sure JDK is installed.

File -> Project Structure -> SDK Location -> Gradle Settings -> change the gradle JDK to the correct one.