Error:Execution failed for task ‘:app:packageRelease’. > Unable to compute hash of /../AndroidStudioProjects/../classes.jar

All the current answers to this question are just giving the Proguard rules that worked for them, every fix will be different. First off, confirm it’s a Proguard problem by checking that the classes-proguard directory is somewhere in the error message, something like this: Unable to compute hash of /Users/Documents/projectX/app/build/intermediates/classes-proguard/release/classes.jar This means it’s caused by … Read more

How can my Gradle build initialize class org.codehaus.groovy.classgen.Verifier?

I’ve been facing the exactly same issue after installing the latest Kotlin Plugin yesterday. This is what resolved the issue for me: I had to change the version of Gradle used as the build tool to (again) use the version installed on my local system. It seems to me that installing the update has caused … Read more

Android Studio: Could not find com.android.tools.build:gradle:2.0.0-alpha2

Apparently the build tools have been moved from maven to jcenter so you need to change the code from: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:2.0.0-alpha2’ } } to this buildscript { repositories { jcenter() } dependencies { classpath ‘com.android.tools.build:gradle:2.0.0-alpha2’ } } More details on the changes: Android Tools Project Site http://tools.android.com/recent … Read more

libpng error: Not a PNG file Error Showing In Android Studio

You should follow below steps. Cut-paste the image on my desktop. Opened it in an editor saved it as png. without renaming the file name. Copy-pasted the .png image into the drawable folder. You can use cruncherEnabled. Returns true if the PNGs should be crunched, false otherwise. android { aaptOptions { cruncherEnabled = false } … Read more

How to customize the APK file name for product flavors?

Try to put this in your android closure of build.gradle buildTypes { debug { // debug buildType specific stuff } release { // release buildType specific stuff } applicationVariants.all { variant -> if (variant.buildType.name.equals(“release”) && variant.productFlavors[0].name.equals(“green”) && variant.zipAlign) { def apk = variant.outputFile; variant.outputFile = new File(apk.parentFile, “green.apk”); } else if(variant.buildType.name.equals(“release”) && variant.productFlavors[0].name.equals(“blue”) && variant.zipAlign) … Read more

Build Warning : Mapping new ns to old ns

Try deleting and reinstalling the SDK platforms. Delete the folders in ~\Android\Sdk\platforms and download the SDKs you need. Edit: The above somehow resolved the issue before, but I ran into the same problem again when more external packages were updated. This time, deleting the SDK platforms didn’t work. Instead, I updated Gradle in two locations … Read more