Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keystore Not Found for Signing Config 'release'

I'm having a problem while running this command on Flutter: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 which I need to run in order to execute flutter build apk.

build.gradle

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.release
        }
    }

key.properties

storePassword=XXXX
keyPassword=XXXX
keyAlias=key
storeFile="C:/Users/User/Key/key.jks"

Error:

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'D:\Projects\Flutter\iusefully\android\app\"C:\Users\User\Key\key.jks"' not found for signing config 'release'.
like image 966
t0m3r Avatar asked Dec 23 '22 17:12

t0m3r


2 Answers

I finally found the answer, my problem was in the key.properties file. The problem occurred because I used storeFile="LOC" The declartion of this variable for the path of the .jks should NOT be in " " quotation.

WRONG: storeFile="C:/Users/User/Key/key.jks"

RIGHT: storeFile=C:/Users/User/Key/key.jks

In addition, I added the key.jks file to the /app folder.

like image 187
t0m3r Avatar answered Dec 26 '22 12:12

t0m3r


this solution work for me... follow this instruction

https://flutter.dev/docs/deployment/android#create-a-keystore

and in key.properties don't put values inside "" ex:

storePassword=454545
keyPassword=456565
keyAlias=upload
storeFile= C:/Users/{profile}/upload-keystore.jks
like image 43
Ahmed Eid Avatar answered Dec 26 '22 10:12

Ahmed Eid