Skip to content Skip to sidebar Skip to footer

Android Studio Cannot Resolve Getdefaultproguardfile

When I run my program i get no problems. When I try to generate signed apk, I am told that getDefaultProguardFile cannot be resolved. How can I fix this. Here is the code. apply pl

Solution 1:

I had the same problem. Note that in the log they are pointing you to go to http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember and there it says:

If you're developing for Android and ProGuard complains that it can't find a method that is only available in a recent version of the Android run-time, you should change the build target in your project.properties file or build.gradle file to that recent version. You can still specify a different minSdkVersion and a different targetSdkVersion in your AndroidManifest.xml file.

I changed the compileSdkVersion & targetSdkVersion from 21 to 22 and it worked.

Solution 2:

@That Thatson :

Just update your buildTypes instead your . Try this way.

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

Solution 3:

You might have to replace the buildtypes codepart with this

signingConfigs {
    release {
        storeFile file("release.keystore")
        storePassword "******"
        keyAlias "******"
        keyPassword "******"
    }
}

buildTypes {
    release {
        signingConfig signingConfigs.release
    }
}

Post a Comment for "Android Studio Cannot Resolve Getdefaultproguardfile"