Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 views
in Technique[技术] by (71.8m points)

android - Gradle signing app with packageRelease “specified for property 'signingConfig.storeFile' does not exist”

I am trying to test an app with Build Variant in release mode in Android Studio with a project using Gradle.

build.gradle:

(omitted dependencies and repositories)

android {
    apply plugin: 'android'
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 16
        versionCode 1
        versionName "1.0"
    }

    signingConfigs {
        release {
            storeFile file("release.jks")
            storePassword "password"
            keyAlias "MobileAndroid"
            keyPassword "password"
        }
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            signingConfig signingConfigs.release
        }
    }
}

If the Build Variant is release Gradle returns an error

A problem was found with the configuration of task ':app:packageRelease'.

File '/Users/andre/workspace/MobileAndroid/app/release.jks' specified for property 'signingConfig.storeFile' does not exist.

Removing "signingConfig.storeFile" returns an Android Studio message box error:

Application Installation Failed

Installation failed since the APK was either not signed, or signed incorrectly. If this is a Gradle-based project, then make sure the signing configuration is specified in the Gradle build script.

release.jks exists and using the Android Studio wizard "Build > Generate Signed APK..." I can generate an app.apk signed.

How do I solve this error in Gradle?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Please double-check that the file exists at the place the error message is looking (Users/andre/workspace/MobileAndroid/app/release.jks) and that there are no permissions problems preventing the files from being read.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...