【发布时间】:2017-07-12 21:28:28
【问题描述】:
在我将 android studio 更新到 Canary 6 之前,一切都很好,当我重建或清理或其他项目时,它会抛出:
执行 com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction 时发生故障
这个错误引导我找到我的vectors.xml [他们都得到了这个错误]
.
我当前的应用级别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,什么也不做。
我已经尝试过什么:
清理并重建。
使缓存无效。
【问题讨论】:
-
android studio canary 6 存在很多问题,我建议你使用 android studio 2.3.3 或将依赖项中的类路径更改为 2.3.3
-
Canary 4 比 5/6 更稳定,特别是如果你使用 Kotlin + ConstraintLayout。
标签: android android-studio android-gradle-plugin android-studio-3.0