Errors while building APK: Algorithm HmacPBESHA256 not available - android

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

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

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.

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

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

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

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

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.

Related

Android studio 2.3 refreshing gradle project taking forever

I updated my android studio to the new version 2.3 and was asked to convert my project to match the new formats which I did. I was asked to update the gradle version too and I did. Now one eternity later it's still refreshing my project gradle. I've restarted it several times and I have active internet connection. Any suggestions
This method works for Me :
Change Gradle Home Path as C:\Program Files\Android\Android Studio\gradle\gradle-3.2
To Open Gradle Home Setting :
Settings->Build,Execution,Deployment->Gradle->Gradle Home
It depends sometimes on what are you building. As Hamid said, it´s a must do working Offline, it greatly reduces times, or at least it did not that long ago.
Also checkout that you are not building google APIs that you are not using, be careful with google's play-services or maps, they sometimes take a bunch of time and maybe you are not using them.
If that's an option, install Android Studio in a SSD, don't buy one, but if you have it, consider moving it, it reduced my gradle about 90%.
Also, check this, a bit old, but may help.
Could be caused by Microsoft Defender.
Check if msmpeng.exe is running in task manager
and exclude Android directory.
using default gradle wrapper and disconnecting from my corporate network to a 4G network solved my problem
File> Settings> Build, Execution, Deployment> Gradle> and check the Offline work
If you have an failed for sync gradle. Such as; Gradle sync failed: Minimum supported Gradle version is 3.3. Current version is 3.2.
Download Gradle supported version manually.
Uncheck "Use default gradle wrapper (recommended)"
Check "Use local gradle distribution" and set Gradle home path.
Check offline work.
Updating the gradle path in
File > Settings > Build, Execution, Deployment > Gradle
worked for me. The problem occured after updating Android Studio.

Gradle error: Write access is allowed from event dispatch thread only in Android Studio

After updating Android Studio to version 2.2 (on Windows 10) and somehow next morning I received such error when gradle built on any project:
Write access is allowed from event dispatch thread only
Despite that gradlew -build command worked and completed successfully.
I tried typical Android dev's of WTF repairing set: clean build, invalidate caches, removing build folders, removing .gradle folder, tried different gradle settings, even reinstalling Android Studio and nothing helped.
I've created this question only to share my experience with community, because I wasted two hours on it.
So the problem was concluded in that Android Studio conflicted with my installed JDK version, so it was resolved when I checked JDK location (File → Project Structure → SDK Location), ticked 'Use embedded JDK' checkbox and set JDK location to 'path to Android Studio'\Android Studio\jre
Problem was occurred when android studio conflict with installed jdk
version, Go to the (File -> Project Structure -> SDK Location), check
'Use embedded JDK' checkbox and set jdk location to 'path to android
studio'\Android Studio\jre :) Simple
that didn't work for me, i ran a 'gradle clean build' command, i figured out that there's a conflict in a line in the gradle, deleted it and sync project (as in this pic)
My issue was that I had removed the SDK I was using while clearing up hard drive space.
To fix this, first check what SDKs you have installed, or install one in Tools > SDK Manager.
You can then change the compileSdkVersion and targetSdkVersion in app build.gradle to your installed sdk version.
Otherwise you can just reinstall what ever sdk you were using.
In Android Studio 3.2.1 go to File -> Project Structure -> SDK Location and check in the check box "Use embedded JDK (recommended)".

‘Icon Name Must Be Set’ Issue Android Studio

I'm following the Udacity course on android programming, and I'm trying to set the icon for the app to the one provided for in the course. When I follow the instruction, the following error prevents me from continuing:
"Icon Name Must Be Set"
I have no missing field on the Configure Image Asset page, so I'm clueless, and googling doesn't seem to help. Anyone have an idea of what's going wrong?
If this helps, heres my gradle sync log
4:23:24 PM Gradle sync started
4:23:30 PM Gradle sync failed: failed to find target android-21 : C:\Users\Administrator\AppData\Local\Android\Sdk
Consult IDE log for more details (Help | Show Log)
4:23:30 PM NullPointerException: null
4:23:48 PM IllegalArgumentException: Invalid paths used when trying to generate an icon
I also get a `null' ide exception when I start up the project.
use Android SDK Manager to update Android API and then open the IDE and update Gradle.
Hopefully, you have found the answer by now, but I will post what seemed to work for me.
I was using Gradle version 2.10 and the source code for the Sunshine project seems to need 2.02 of Gradle. When I downloaded this older version, I no longer got the weird "Icon Name Must Be Set" issue.
To change the version of Gradle used :
Android Studio -> Preferences
Build, Execution, Deployment
Build Tools
Gradle
Select the option "User local gradle distribution" and navigate to the location where the gradle version you want to use is located.
Click apply and ok after. That should do it. It worked for me at least.
I am using a Mac (El Cap) with the latest version of Android Studio 2.1.1

Installed the latest version of Android Studio, Exception occurred when I built the project?

An Android project, It was good with the older version of Android Studio. But after I updated the IDE version, An exception will occured when I build the project whith gradle.
Here is the problem:
Error:Execution failed for task ':jellyrefresh:compileReleaseJava'.
When running gradle with java 5, 6 or 7, you must set the path to jdk8, either with property retrolambda.jdk or environment variable
JAVA8_HOME
The thing is, my environment is Windows XP(I don't want to update), So I cannot install Java 8, so no need to tell me to do that. But I still want to use the Android Studio's latest version.
So what's the most resonable solution to this exception?
Go to File -> Project Structure -> SDK Location -> JDK Location and change the path to Java 8 Home, then Rebuild project.
The snapshot was taken from Mac. However, it should work for others too.
You can open build.gradle to take a look, maybe you used retrolambda to compile javacode, which needs java8.

Gradle not syncing in Android studio (v1.1.0)

When I attempt to sync, I get the following error:
The supplied javaHome seems to be invalid. I cannot find the java executable. >Tried location: C:\Program Files\Java\jdk1.8.0_45\bin\java.exe
Maybe i need to use jdk 1.7, but I cant seem to change it, please help (I have jdk 1.7)
For fixing the problem inside IntelliJ Idea do the following :
File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JVM -> Change to your appropriate JVM
Check File, Project Structure, here you can change the JDK:
Here you can select the source and target compatibility as well:
This information refers to Android Studio.
In Intellij (or Android Studio) you have to download Gradle file from the Gradle website and then go to Intellij settings choose the manual configuration, then point the Gradle address you have downloaded.
In the same issue I resolved this error like this.

Categories

Resources