4

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
Marckaraujo
  • 7,422
  • 11
  • 59
  • 97
  • 1
    Related: http://stackoverflow.com/questions/19294663/cannot-build-android-project-using-android-studio-gradle-1-7 - error 139 seems to mean ["Segmentation Fault"](http://stackoverflow.com/a/15600683/995891), in your case in `dx` which is kind of bad because that's not supposed to happen. Try running the command it fails to manually from a console and see if you can see more of an error message. – zapl Nov 15 '14 at 02:47

3 Answers3

5

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.
Community
  • 1
  • 1
Marckaraujo
  • 7,422
  • 11
  • 59
  • 97
2

I had the same problem and it was fixed simply by restarting Android Studio.

I can only guess at the cause, but I think it happened because I launched my app while my emulator was still booting up.

0

Seems like you have build-tools 21.0.2 installed but you are using 20.0.0 in your gradle buildTootlsVersion Also you have defined repositories twice and you need it only in the first gradle block.

Try changing the build tools version.

mistwalker
  • 781
  • 7
  • 9
  • I already set build-tools 21.0.2 , I just tried with many others and still the same bug, it sometimes says that the problem is with another library jar – Marckaraujo Nov 15 '14 at 00:01