KDApps
KDApps

Reputation: 101

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

Upvotes: 9

Views: 20562

Answers (7)

Samuel Mutemi
Samuel Mutemi

Reputation: 398

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.

Upvotes: 0

Rog
Rog

Reputation: 21

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

Upvotes: 2

13garth
13garth

Reputation: 793

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

Upvotes: 0

Dillion
Dillion

Reputation: 184

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

Upvotes: 0

Kusuma
Kusuma

Reputation: 1

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

Upvotes: 0

James Barboza
James Barboza

Reputation: 119

Make sure JDK is installed.

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

Upvotes: 10

Vidyesh Churi
Vidyesh Churi

Reputation: 2589

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.

Upvotes: 6

Related Questions