'Build app flutter "flutter build apk --flavor staging --release"

I can build flutter app by command-line "flutter build apk --flavor stg --release" but i through erorr "Keystore file not set for signing config release".



Solution 1:[1]

Follow the document about release flutter app https://docs.flutter.dev/deployment/android

On Mac/Linux, use the following command:

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

On Windows, use the following command:

  keytool -genkey -v -keystore c:\Users\USER_NAME\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

In Run/Debug Configurations

In line "Additionl run args:" type "--debug" In line "Build flavor" type "staging"

And Run command: flutter build apk —release --flavor staging

This is example

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1