0
1

More than 1 year has passed since last update.

Flutter Androidビルド作成が失敗するKeystore file ‘android/app/key.jks' not found for signing config 'release'.

Last updated at Posted at 2023-02-12

はじめに

FlutterアプリをGoogle Play Storeに公開する手順は以下のような記事で解説されています。

ただ、私の場合はその通りにやってもできなかったので、、、ここに記録したいと思います。

私はAndroidアプリを公開するのは初めてではないので、既にkeystoreファイルは持っています。なので最初の準備はすっ飛ばして進めました。

だからなのかわかりませんが、flutter build appbundleの部分でエラーに見舞われました。。

前提

Keystoreファイルの作成、key.propertiesの作成などここまでの手順は完了済みとする。

必要ファイルは👇のように設置。

Screenshot 2023-02-13 at 1.53.38.png

Keystoreが見つからないと言われる

flutter clean
flutter pub get
flutter build appbundle

を順に実行すると以下のようなエラーが発生。。。

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file '/Users/user/Desktop/basic/flutter/sample/android/app/key.jks' not found for signing config 'release'.

* 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 57s
Running Gradle task 'bundleRelease'...                             66.2s
Gradle task bundleRelease failed with exit code 1

Keystoreファイルが見つからないようだ。

参考にした記事の通りにkey.propertiesを作成したが、コピペではダメだったようだ。

Android StudioのGenerate Signed Bundleを確認

まず私の場合はkeyAliasが違ったようです。。
私の場合すでにAndroidアプリをリリースしているので、そっちでBuild>Generate Signed Bundleで確認ができます。

Screenshot 2023-02-13 at 1.57.03.png

また画像と同じような感じでkey.propertiesのstoreFileへのパスですが参考記事のコピペではなく、絶対パスで指定すると通りました!

key.properties
storePassword=パスワード
keyPassword=パスワード
keyAlias=key0
storeFile=/Users/user/Desktop/basic/flutter/sample/android/app/keystore
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1