1

I'm getting this error executing my Android app (I cleaned it and then built it, but the error is still present)

Sync: OK

Make Project: Error

Clean: Error

Run: Error

Error:Execution failed for task ':app:dexDebug' .com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/Jude/Library/Android/sdk/build-tools/23.0.2/aapt' finished with non-zero exit value 1

I enabled multidex support with 'multiDexEnabled true' but the error keep coming up.

My gradle file:

apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '23.0.2'

defaultConfig {
    applicationId 'com.kakao.inhouseagit'
    minSdkVersion 16
    targetSdkVersion 23
    multiDexEnabled true

    buildConfigField "String", "DEPLOY_PHASE", "\"PreRelease\""
    buildConfigField "boolean", "DEBUG_TRACE", "true"
    buildConfigField "boolean", "inhouse", "true"
}

signingConfigs {
    debug {
        storeFile file('keystore/debug.keystore')
    }
    release {
        storeFile file('keystore/kakao.keystore')
        storePassword 'sksmswjstjfdlek'
        keyAlias 'kakao'
        keyPassword 'sksmswjstjfdlek'
    }
}

buildTypes {
    alpha {
        debuggable true
        signingConfig signingConfigs.debug
        buildConfigField "String", "DEPLOY_PHASE", "\"Alpha\""
    }
    beta {
        debuggable true
        signingConfig signingConfigs.debug
        buildConfigField "String", "DEPLOY_PHASE", "\"Beta\""
    }

    preRelease {
        debuggable true
        signingConfig signingConfigs.debug
        buildConfigField "String", "DEPLOY_PHASE", "\"PreRelease\""
    }

    release {
        minifyEnabled true
        shrinkResources true
        debuggable false
        buildConfigField "boolean", "DEBUG_TRACE", "false"
        buildConfigField "String", "DEPLOY_PHASE", "\"Release\""
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt', 'proguard_clearlog.cfg'
        signingConfig signingConfigs.release
    }
}

lintOptions {
    checkReleaseBuilds true
    abortOnError false
    checkAllWarnings true
    xmlReport true
    htmlReport true
    disable "InvalidPackage", "MissingTranslation"
}

packagingOptions {
    exclude 'META-INF/DEPEDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}

productFlavors {
    inhouse {
        applicationId 'com.kakao.inhouseagit'
        testApplicationId 'com.kakao.inhouseagit-test'
        versionCode 82
        versionName '2.7.1.1'
        buildConfigField "boolean", "inhouse", "true"
    }

    io {
        applicationId 'io.agit'
        testApplicationId 'io.agit-test'
        versionCode 10
        versionName '1.0.2'
        buildConfigField "boolean", "inhouse", "false"
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.4'
}

repositories {
    maven { url 'http://maven.daumcorp.com/content/groups/daum-ma-group' }
    maven { url 'http://maven.daumcorp.com/content/groups/daum-public' }
}

dependencies {
    compile(group: 'com.kakao.sdk', name: 'kakaolink', version: '1.0.52') {
        exclude group: 'com.google.android', module: 'support-v4'
    }
    compile 'com.android.support:support-annotations:23.0.1'
    compile 'com.google.android.gms:play-services-gcm:8.1.0'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.guava:guava:18.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'commons-io:commons-io:2.4'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.9'
    compile 'com.fasterxml.jackson.core:jackson-core:2.6.2'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.2'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.6.2'
    compile 'com.melnykov:floatingactionbutton:1.3.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile('org.apache.httpcomponents:httpmime:4.2.2') {
        exclude group: 'org.apache.httpcomponents', module: 'httpcore'
        exclude group: 'commons-logging', module: 'commons-logging'
    }

    // for multi dex
    compile 'com.android.support:multidex:1.0.1'

    // for Emoticon SDK
    // emoticon sdk를 사용하기 위해 필요.
    compile(group: project.KAKAO_SDK_GROUP, name: 'kakaolink', version: project.KAKAO_SDK_VERSION)
    compile project(':emoticon')

    testCompile 'junit:junit:4.12'
    testCompile "org.mockito:mockito-core:1.10.19"
    compile "com.davemorrissey.labs:subsampling-scale-image-view:3.3.0"
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    alphaCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    betaCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    preReleaseCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}

// TODO remove legacy package
useLibrary 'org.apache.http.legacy'

}

It was fine before I put

compile 'com.android.support:design:23.1.1'

I changed my layout with Navigationview, so i put 'com.android.support"desing:23.1.1' then error keep coming up. And now, when i press 'run', 'Gradle Buid Running' takes like 10~15mins and ended up with same error.

My project gradle uses classpath 'com.android.tools.build:gradle:1.3.1' If someone could please give me a few pointers as to where i am going wrong, i would be immensivly grateful. This is killing me.

Thanks.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Jude KIM
  • 109
  • 1
  • 4

5 Answers5

1

I was struggling with this same issue but at a different version. My android studio asked me to change my buildToolsVersion in my build.gradle (module: app) to a version of atleast 21.0.0. So I switched from 20.0.0 to 21.0.0 and I then began to get the error message mentioned above regarding the aapt.

Solution: I changed my buildToolsVersion to "23.0.3", cleaned project, rebuilt project and then I was able to build my app on a device without any issues.

I hope this helps.

Merc
  • 393
  • 5
  • 10
0

You compile so many jars in your project.Terriable experience for waiting 10~15mins.

An outofmemory error may output this log :' finished with non-zero exit value 1'.

I have solve a similar problem by adding this:

dexOptions {
    javaMaxHeapSize "2g"
    preDexLibraries = true
}

Have a try.Hope it helps.

banking
  • 480
  • 2
  • 9
  • I solved it by building Terminal. But error comes up with android studio button even after i put your build codes. http://developer.android.com/intl/ko/tools/building/building-cmdline.html Thanks. anyway. – Jude KIM Mar 30 '16 at 01:02
0

You can use so many library that's why your project will take to much time to sync your gradle file and please check is there any same duplicate library or not or visit this [ failed to resolve com.android.support:appcompat-v7:22 and com.android.support:recyclerview-v7:21.1.2

it will helped for me. Other thing is compile 'com.android.support:design:23.1.1' is working in my project i am using latest sdk and API level 23 i hope this will help you

Community
  • 1
  • 1
Farmer
  • 4,093
  • 3
  • 23
  • 47
  • I solved it by building with Terminal. http://developer.android.com/intl/ko/tools/building/building-cmdline.html Thanks anyway! – Jude KIM Mar 30 '16 at 01:00
-1

You can go to AdroidStudio's menu Build->Clean Project. Afterward restart Studio.

It used to help me )

sanya5791
  • 433
  • 4
  • 5
-1

It seems that you are using outdated gradle version. I've faced this issue with RUN and it fixed by doing this:

Start by updating "gradle" to the latest version:

'com.android.tools.build:gradle:2.1.0-alpha4'

and update the gradle wrapper to the latest version (at "gradle-wrapper.properties" file):

distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip

than try to clear cash from: File > invalidate caches / Restart.

Mohd
  • 71
  • 7