Failed Generating Signed Apk (FGSA)

Hi dev, when I used to change operating systems, I often encountered this kind of error.

When generating  signed apk  from android studio suddenly an error occurred even though in the previous OS it was normal. A few days later everything worked fine.

Once, on another occasion about 2 weeks later, I also faced a similar problem after trying to reinstall my Linux OS.

The error reads like this.

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 tried checking that folder and the release-stripped.ap file is in it. I couldn't find any significant error.

This was  build.gradle my project at that time.

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

Please help, thank you.

Enlightenment

Follow the steps below to clear your 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 delete - this line shrinkResources false

Done!


Post a Comment

Previous Next

نموذج الاتصال