Android studio 3.0 Canary 6 A failure occurred whi

2019-03-24 07:32发布

All was fine until i updated the android studio to Canary 6, When i rebuild or clean or whatever with project it's throw :

A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction

And this error guide me to my vectors.xml [All of them got this error] .

My Current app level build.gradle :

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "example.project"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 42
        versionName "1.3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        //multiDexEnabled = true
    }
    buildTypes {
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
}


dependencies {

    compile 'com.android.support:appcompat-v7:25.3.1'//<-- can't update to new one
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.android.support:support-v13:25.3.1'
    compile 'com.android.support:palette-v7:25.3.1'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.squareup.okhttp3:okhttp:3.0.1'
    compile 'com.android.support:multidex:1.0.1'
    testCompile 'junit:junit:4.12'
}

Also when i tried to download com.android.support libraries, The IDE just search for the sdk and just do nothing.

What i have been tried :

  • Clean and Rebuild.

  • Invalidate Caches.

7条回答
干净又极端
2楼-- · 2019-03-24 08:30

Just add vectorDrawables.useSupportLibrary = true in defaultConfig, it's work fine for me

defaultConfig {
        vectorDrawables.useSupportLibrary = true
}
查看更多
登录 后发表回答