0

I want to generate signed apk in android studio of my project but It is giveing me error.I am new to android, please help me in this.

Gradle console gives stack trace like this:

Executing tasks: [:app:assembleRelease]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
:app:processReleaseManifest UP-TO-DATE
:app:processReleaseResources UP-TO-DATE
:app:generateReleaseSources UP-TO-DATE
:app:compileReleaseJava UP-TO-DATE
:app:lintVitalRelease
:app:compileReleaseNdk UP-TO-DATE
:app:preDexRelease UP-TO-DATE
:app:dexRelease UP-TO-DATE
:app:processReleaseJavaRes UP-TO-DATE
:app:validateExternalOverrideSigning
:app:packageRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':app:packageRelease'.
> File '2222' specified for property 'signingConfig.storeFile' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.685 secs

Also console messages gradle:

Information:Gradle tasks [:app:assembleRelease]
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
:app:processReleaseManifest UP-TO-DATE
:app:processReleaseResources UP-TO-DATE
:app:generateReleaseSources UP-TO-DATE
:app:compileReleaseJava UP-TO-DATE
:app:lintVitalRelease
:app:compileReleaseNdk UP-TO-DATE
:app:preDexRelease UP-TO-DATE
:app:dexRelease UP-TO-DATE
:app:processReleaseJavaRes UP-TO-DATE
:app:validateExternalOverrideSigning
:app:packageRelease FAILED
Error:A problem was found with the configuration of task ':app:packageRelease'.
> File '2222' specified for property 'signingConfig.storeFile' does not exist.
Information:BUILD FAILED
Information:Total time: 3.685 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

My Gradle File is like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.mubashirgul.androidtest"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

            debug {

            }

    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
}
killer
  • 592
  • 1
  • 9
  • 31
  • 1
    Can you add the gradle file please. Just make sure you remove any passwords :) – Flaxie Apr 02 '15 at 08:04
  • Please check question again. – killer Apr 02 '15 at 08:07
  • Could be because the build tools version is: `buildToolsVersion "21.1.2"` but the appcompat library you're using is `com.android.support:appcompat-v7:22.0.0`. Consider using the same version. – frek13 Apr 02 '15 at 08:10
  • Check this question: [Gradle signing app with packageRelease “specified for property 'signingConfig.storeFile' does not exist](http://stackoverflow.com/questions/21780847/gradle-signing-app-with-packagerelease-specified-for-property-signingconfig-st) – frek13 Apr 02 '15 at 08:17
  • https://stackoverflow.com/a/62654181/8663316 – Faizan Haidar Khan Jun 30 '20 at 09:21

1 Answers1

1

This is how i'm doing it:

build.gradle:

apply plugin: 'com.android.application'

android {
.
.
.

signingConfigs {
    release
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles 'proguard.pro'
        debuggable false
        signingConfig signingConfigs.release
    }
.
.
.
}

dependencies {
    ...
}

def props = new Properties()

props.load(new FileInputStream(rootProject.file("keystore.properties")))
android.signingConfigs.release.storeFile rootProject.file(props.keyStore)
android.signingConfigs.release.storePassword props.keyStorePassword
android.signingConfigs.release.keyAlias props.keyAlias
android.signingConfigs.release.keyPassword props.keyAliasPassword

keystore.properties:

keyStore=manamana.keystore_filname
keyStorePassword=manamana_password
keyAlias=manamana_alias
keyAliasPassword=manamana_alias_password

Then i have the keystore in root of project and the "keystore.properties" is added to .gitignore and never checked in

Flaxie
  • 540
  • 3
  • 13