Hareesh
Hareesh

Reputation: 943

Unable to Generate Signed APK in Android Studio gives me error with proguard-rules.txt not found?

Hi I am new to Android Studio to build and generate signed apk file. I tried alot to generate APK file but I am stuck on this.

I found some links to generate signed apk file, please check below.

http://xda-university.com/as-a-developer/getting-started-android-studio http://www.techotopia.com/index.php/Generating_a_Signed_Release_APK_File_in_Android_Studio

I followed same way but in that process it is not showing Run Proguard option to check and generate apk file, please see below.

enter image description here

enter image description here

Please check my below code Here:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:17'
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.wasl.properties"
        minSdkVersion 9
        targetSdkVersion 17
        versionCode 8
        versionName "2.1"
    }

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

dependencies {
 compile 'com.google.android.gms:play-services:+'
 compile files('libs/commons-codec-1.4.jar')
 compile files('libs/FlurryAnalytics_3.3.0.jar')
 compile files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar')
 compile files('libs/universal-image-loader-1.8.5-with-sources.jar')
 compile 'com.android.support:support-v4:21.0.3'
}

Please help on this , Thanks in Advance.

Upvotes: 4

Views: 1465

Answers (1)

Adam S
Adam S

Reputation: 16414

In your build.gradle file, you have the default proguard processing step enabled for your release build. The build process is attempting to run proguard (that's the minifyEnabled line) and searching for the files specified on the line below (which, according to your error message, don't exist).

If you don't want to run proguard (and at this stage, I presume you don't) you should delete the contents of the release build type:

buildTypes {
    release {
    }
}

Upvotes: 1

Related Questions