一切都很好,直到我将 android studio 更新到 Canary 6,当我重建或清理或其他项目时,它会抛出:
执行 com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction 时发生故障
这个错误引导我到我的vectors.xml
[他们都遇到了这个错误]
。
我当前的应用程序级别构建.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,什么也不做。
我已经尝试过:
添加多密度矢量图形的优点是使用矢量而不是位图来减小 APK 的大小,因为可以针对不同的屏幕密度调整同一文件的大小,而不会损失图像质量。对于不支持矢量绘图的旧版 Android,Vector Asset Studio 可以在构建时将矢量绘图转换为针对每种屏幕密度的不同位图大小
classpath 'com.android.tools.build:gradle:3.0.0-alpha8
构建.gradle
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)