Error message when buildar apk on Flutter console

Asked

Viewed 688 times

0

When I try to give a flutter build apk --release in my app it returns the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'C:\Users\Lucas Daniel\androiapp\android\app\Users\Lucas Daniel\androiapp\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 6s

However the path to the file is correct, despite repeating twice in msg, I do not understand. This is my key properties file.:

storePassword=lucas17
keyPassword=lucas17
keyAlias=key
storeFile=/Users/Lucas Daniel/androiapp/key.jks

And this here is my build.Radle file:

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

android {
    compileSdkVersion 27

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.androiapp"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
}
buildTypes {
    release {
        signingConfig signingConfigs.release
    }
}

Anyone can help?

  • 2

    C:\Users\Lucas Daniel\androiapp\android\app\Users\Lucas Daniel\androiapp\key.jks is correct? Did not miss C: in storeFile ? ... storeFile=C:/Users/Lucas Daniel/androiapp/key.jks

  • 1

    I added and the error persisted equal, so I closed and opened the console again and I succeeded!!! Thank you very much, that error came out as a dot and comma in a Debug, but I’ll stay more attentive, good job!

  • If you want to put your comment as an answer I’ll give you the upvote

1 answer

1

The reply was given by @Noobsaibot in the comments:

Was missing the C: in the storeFile:

storeFile=C:/Users/Lucas Daniel/androiapp/key.jks

Browser other questions tagged

You are not signed in. Login or sign up in order to post.