Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

finished with non zero exit value

I was getting this exact same error. I ran the command

./gradlew assembleDebug --info

Where "assembleDebug" was replaced with the assemble task for a debug version of the flavor I wanted.

Look for output

Successfully started process 'command '/usr/local/opt/android-sdk/build-tools/21.1.2/aapt''

Right below that was an error describing a resource which I used in a layout file but which was missing from the dimensions files. Fixing this fixed the build issue.


At first you go to

Build -> Clean Project 

and then go to

Build -> Rebuild Project

and finish the error is a way


Install the latest version of the build tools. Adjust your build.gradle to use

android {
    compileSdkVersion {X}
    buildToolsVersion "{X.Y.Z}"
   ...
}

Proper values should match your installed SDK. Could be 23.0.3 at the time of this post.
or check and remove duplicate dependencies from list.

Enjoy :)


Follow this simple steps to recover this error:

Method 1:

-Go to File->project structure->Project
-Check Android plugin Version and change it to 1.3.0(Latest one)
-Go to File->project structure->app->Properties->Build Tools Version
-Change it to latest one(22.0.1). Also do this for any other module you have for your project.
-Clean and build project.

Note: If your build tool version is less than 22.0.1 then you may still face same error while gradle build so please update your SDK from SDK Manager to latest one then restart android studio and follow above steps.

Method 2:

-If you don't want to update build tools version or you don't have latest SDK version just Go to File->project structure->Project.
-Check Android plugin Version and change it to 1.0.0(Older one)
-Clean and build project.

I recommended Method 1.