Search code examples
javaandroid

Java android fix Failed to crunch file


When I added to my project compile 'com.android.support:design:25.2.0' and sync project I see this :

Error:Failed to crunch file C:\Users\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.2.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png

This is my build.gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "24.0.3"

    defaultConfig {
        applicationId " xx"
        minSdkVersion 8
        targetSdkVersion 19
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:design:25.2.0'
    compile files('libs/android-support-v4.jar')
    compile files('libs/joda-time-2.3.jar')
    compile files('libs/ksoap2-android-assembly-3.6.0-jar-with-dependencies.jar')
    compile files('libs/osmbonuspack_v4.9.jar')
    compile files('libs/osmdroid-android-4.2-javadoc.jar')
    compile files('libs/osmdroid-android-4.2.jar')
    compile files('libs/slf4j-android-1.5.8.jar')

}

Solution

  • You can use

     aaptOptions
       {
       cruncherEnabled = false
       } 
    

    FYI

    Call buildToolsVersion "25.0.1" instead of buildToolsVersion "24.0.3"

    • compile 'com.android.support:design:25.1.0'
    • call compileSdkVersion 25 instead of 19 .

    Then Clean-Rebuild-Restarts and Sync your IDE