Jayashri
Jayashri

Reputation: 21

Error for Proguard Rules while Generating Signed APK

This is my build.gradle(app) file..

apply plugin: 'com.android.application'

android {

compileSdkVersion 26

defaultConfig {
    applicationId "com.example.odev09.eazyvisi"
    minSdkVersion 16
    targetSdkVersion 19
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

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

    debug {
        debuggable true
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

When I Generate Signed APK it will give below error

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.

Upvotes: 0

Views: 463

Answers (2)

Poovarasan Selvaraj
Poovarasan Selvaraj

Reputation: 169

Just try,

Your compileSdkVersion 26 so You need to change Targetsdk version

targetSdkVersion 26
buildToolsVersion '26.0.2'

my suggestion try this, applicationId contain three parts so change this one also

(eg: com.test.android)

Upvotes: 0

Nikunj
Nikunj

Reputation: 4157

Add these lines to your proguard-rules.pro

-ignorewarnings

-keep class * {
    public private *;
}

Upvotes: 1

Related Questions