背景
Flutterで作成したandroidアプリを始めてリリースする際、アップロード用アプリをビルドするところで躓きました。
エラー文
terminalでアプリをビルドするコマンドを打ったらエラーが出ました。
$ flutter build apk
C:\Users\<フォルダ名>\<アプリ名>>flutter build appbundle
Building without sound null safety
For more information see [https://dart.dev/null-safety/unsound-null-safety](https://dart.dev/null-safety/unsound-null-safety)
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'C:\Users\<フォルダ名>\<アプリ名>\android\app\key.jks' not found for signing config 'relea
se'.
- 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 g
et full insights.
- Get more help at [https://help.gradle.org](https://help.gradle.org/)
BUILD FAILED in 22s
Running Gradle task 'bundleRelease'... 24.2s
Gradle task bundleRelease failed with exit code 1""
解決方法
keyの設置場所が間違っていて、android/key.propertiesのstoreFileを以下の値に修正したらエラーがなくなりビルドに成功しました。
android/key.properties
storePassword=<自分のパスワード>
keyPassword=<自分のパスワード>
keyAlias=key
storeFile= ./key.jks