Android Studio 3.0 Canary 6执行com.android.build.gradle.tasks.MergeResources $ FileGenerationWorkAction时发生故障

Android Studio 3.0 Canary 6执行com.android.build.gradle.tasks.MergeResources $ FileGenerationWorkAction时发生故障

问题描述:

在我将android studio更新为Canary 6之前,一切都很好,当我重建或清理项目时,它会抛出:

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

执行com.android.build.gradle.tasks.MergeResources $ FileGenerationWorkAction时发生故障

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

此错误将我引向我的vectors.xml [所有人都收到此错误]

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

我当前的应用级别 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'
}

此外,当我尝试下载com.android.support库时,IDE只是搜索sdk而无所事事.

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

我已经尝试过的东西:

  • 清理并重建.

  • Clean and Rebuild.

使缓存无效.

添加多密度矢量图形的优点是使用矢量而不是位图来减小APK的大小,因为同一文件的大小可以针对不同的屏幕密度进行调整,而不会损失图像质量.对于不支持矢量可绘制对象的旧版Android,Vector Asset Studio可以在构建时针对每个屏幕密度将矢量可绘制对象转换为不同的位图大小

The advantage of adding a multi-density vector graphic is to use a vector instead of a bitmap to reduce the size of the APK because the size of the same file can be adjusted for different screen densities without loss off image quality. For older versions of Android that don't support vector drawables, Vector Asset Studio can, at build time, turn your vector drawables into different bitmap sizes for each screen density

 classpath 'com.android.tools.build:gradle:3.0.0-alpha8

build.gradle

build.gradle

android {
  defaultConfig {
    vectorDrawables.useSupportLibrary = true
  }
}