Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Execution failed for task ':app:preDexDebug' [duplicate]

This strange behavior is happenning with my build application.

The strange is that this com.nineoldandroids is a jar that is from android resource libraries.

I have tried to delete build source and recompile again without luck.

My buildgradle:

buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'

repositories {
    maven { url 'http://download.crashlytics.com/maven' }
}

android {
    compileSdkVersion 21
    buildToolsVersion "20.0.0"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    defaultConfig {
        applicationId "xxxxxxxx"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            // enable crashlytics where you need
            buildConfigField "boolean", "USE_CRASHLYTICS", "false"
            ext.enableCrashlytics = false
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':library_refreshaction_appcompat')
    compile project(':EnhancedListView')
    compile project(':library_numberpicker')
    compile project(':materialDesign')
    compile project(':library_typeface')
    compile project(':library_updatechecker')
    compile 'com.android.support:appcompat-v7:21.0.0'
    compile 'com.android.support:support-v4:21.0.0'
    compile 'com.crashlytics.android:crashlytics:1.+'
    compile 'se.emilsjolander:stickylistheaders:2.5.0'
    compile files('libs/Parse-1.7.1.jar')
    compile files('libs/BixolonPrinter.jar')
    compile files('libs/bolts-android-1.1.3.jar')
    compile files('libs/core-3.1.0.jar')
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/universal-image-loader-1.9.2.jar')
    compile files('libs/VposAPI.jar')
    compile project(':android-support-v4-preferencefragment-master')
}

Error Log:

Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /Users/Marcus/Downloads/adt-bundle-mac-x86_64-20140702/sdk/build-tools/21.0.2/dx --dex --output /Users/Marcus/Workspace/android-pdv/app/build/intermediates/pre-dexed/debug/library-2.4.0-c0bb3fabf202a58f481b22d99eb3ba9b89fd232d.jar /Users/Marcus/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar
  Error Code:
    139
like image 382
Marckaraujo Avatar asked Mar 17 '23 21:03

Marckaraujo


1 Answers

As linked by @zapl Cannot build android project using Android Studio - Gradle 1.7, it is a strange behaviour that doesn't have only one way to solve it, as related by this post.

I couldn't say exactly what I did to solve it, because I tried many things until it disappeared.

But as said in the post, this is the way:

  • Malformed Resources (Missing attributes, wrong tags, etc...)
  • +id in Styles
  • Duplicated resources / libraries
  • Declare-Style able missing name
  • Resource miss-match, try to use different AAPT versions.

Unknown, like mine. So it would be useful to:

  1. Find a way to identify the real cause of this error
  2. Wait for an update to AAPT that returns some error message
  3. Write a list of possible common causes.
like image 130
Marckaraujo Avatar answered Apr 06 '23 16:04

Marckaraujo