A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade -------flutter

1.1k views Asked by At

I was trying to build an appbundle, but this error shows up.

C:\Users\IMBA\AndroidStudioProjects\quizzi>flutter build appbundle

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 key from store "C:\Users\IMBA\AndroidStudioProjects\quizzi\android\app\key.jks": Keystore was tampered with, or password was incorrect

* 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 https://help.gradle.org

BUILD FAILED in 11s
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done                        12.2s
Gradle task bundleRelease failed with exit code 1

The problem occurred for the second time, so I made a new key.jks file. But the problem is still the same.

1

There are 1 answers

0
Dan Gerchcovich On

Looks like there is an issue with you signing the appbundle. Try to resign the app with another key.

Make sure not to include the keystore file in source control because it's a security hazard.

Have a look at this documentation here to get started. https://flutter.dev/docs/deployment/android

After all this is done, run the following command:

flutter clean
flutter build appbundle

If you are having issues with treeshaking while building the app, run this command here:

flutter build appbundle --no-tree-shake-icons