I have this error at the moment to make flutter build appbundle

this is the error:

FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:signReleaseBundle'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Failed to read key sd from store "C:\flutter_project\cursin2\cursin-main\android\app\upload-keystore.jks": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at BUILD FAILED in 6s Running Gradle task 'bundleRelease'... 9,1s Gradle task bundleRelease failed with exit code 1 PS C:\flutter_project\cursin2\cursin-main> 

enter image description here

i've tried all ways to fix it, but the error is still appearing.

my key.properties:

storePassword=ul109000 keyPassword=ul109000 keyAlias=sd storeFile=C:/flutter_project/cursin2/cursin-main/android/app/upload-keystore.jks 
1

5 Answers

in android app/ build.gradle

inside android tag

def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } signingConfigs { debug { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile file(keystoreProperties['storeFile']) storePassword keystoreProperties['storePassword'] } release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile file(keystoreProperties['storeFile']) storePassword keystoreProperties['storePassword'] } } 

storeFile path will be ./upload-keystore.jks

and

 buildTypes { debug { signingConfig signingConfigs.debug } release { minifyEnabled true shrinkResources true signingConfig signingConfigs.release } } 
4

In my case key.properties file was missing(you can find that in android/build.gradle). If you have cloned your repo from github and then try to create appbundle then this issue may arise.

Generate new key.properties or take previous key.properties file to create appbundle.

0

The only method to solve this, that worked for me was:

  1. flutter clean
  2. edit the path i used in key propeties.

For example: "./upload-keystore.jks" to "C:/key/myapp/upload-keystore.jks" 3. flutter build appbundle

Delete this:

debug { storeFile file(storeFile_) storePassword storePassword_ keyAlias keyAlias_ keyPassword keyPassword_ } 

First

in android app/ build.gradle

replace this

 buildTypes { release { signingConfig signingConfigs.release } } 

with this

 buildTypes { debug { signingConfig signingConfigs.debug } release { minifyEnabled true shrinkResources true signingConfig signingConfigs.release } } 

Second

remove upload-keystore.jks in your generation path in my case (Ubuntu OS) the path is /home/user/upload-keystore.jks

Third

genrate a new key with with extra attribute

-storetype JKS 

for Linux

keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload -storetype JKS 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.