finished with non zero exit value

I am trying to import my project. but when I run the application I am getting the following error:

Error: Execution failed for task ':app:processDebugResources'.
 > com.android.ide.common.process.ProcessException:      
   org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Vishnu  Ruhela\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non- zero exit value 1

here is my gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.example.vishnuruhela.signup"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors { }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile project(':listView1')
}

Solution 1:

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.

Solution 2:

At first you go to

Build -> Clean Project 

and then go to

Build -> Rebuild Project

and finish the error is a way