2

while generating signed apk from android studio getting error. Few days later all works good, while from last 2 days I am facing problem to generate signed apk.

Error is -

FAILURE: Build failed with an exception. What went wrong:

A problem was found with the configuration of task ':app:packageRelease'. File '/media/user86/data/MySIPonline/app/build/intermediates/res/resources-release-stripped.ap_' specified for property 'resourceFile' does not exist.

I'll checked that folder and release-stripped.ap file is present in it. I am not able to figure out the error.

Here is build.gradle (app)

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.xxxxxxxxxx"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 15
    versionName "1.5.1"
    multiDexEnabled true
}

buildTypes {
    release {
        minifyEnabled false
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dexOptions {
    javaMaxHeapSize "2048M"
}}


repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }}



dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.5'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/paynimo_v2.0_live.jar')
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
    transitive = true;
}
compile files('libs/paynimo.scanner.jar')
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
}
apply plugin: 'com.google.gms.google-services

Here is link for pro-guard file - https://gist.github.com/Sanwal13/b667326812b87702c86fa02870b28240

Please help and thanks in advance.

  • check out here..http://stackoverflow.com/questions/34629723/signingconfig-storefile-does-not-exist-when-i-try-to-run-the-project – brahmy adigopula Oct 17 '16 at 06:51
  • Possible duplicate of [\build\intermediates\res\resources-anzhi-debug-stripped.ap\_' specified for property 'resourceFile' does not exist](http://stackoverflow.com/questions/36540676/build-intermediates-res-resources-anzhi-debug-stripped-ap-specified-for-prope) – wojtek.kalicinski Jan 09 '17 at 17:59

3 Answers3

2

You need to set the shrinkResources property to false as it doesn't work with Instant Run feature. If you are using Android Studio 2.2 simply specify it in your manifest as:

buildTypes {
release {
    minifyEnabled false
    shrinkResources false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

if you are using Android Studio 2.0

  1. Open Settings.
  2. Select Build, Execution and Deployment.
  3. Uncheck enable Instant Run option.
Jordan
  • 713
  • 15
  • 30
0

clean your project and try to generate signed APK i have the same issue i clean the project rebuilt the project it work for me.

Nouman Shah
  • 534
  • 1
  • 9
  • 22
0

Follow below steps to remove you error -

Step 1 : - Clean your project

Step 2 : - Rebuild your project

Step 3 : - Invalidate and Restart Android Studio

Step 4 : - Edit build.gradle with below code

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

Just remove - this line

shrinkResources false

Problem solve :)

brahmy adigopula
  • 617
  • 3
  • 15
Sanwal Singh
  • 1,765
  • 3
  • 17
  • 35