:app:transformResourcesWithMergeJavaResForDebug FAILED

资源xml有错误,应该排查每一处xml。

如果提示gradle相关错误,需要修改系统级的build.gradle和程序级的build.gradle,比如后者不能缺少:
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:21.0.3'
}

项目配置入口:File->Project Structure--Moules--
修改它就相当于修改程序级的build.gradle

gradle提示中文乱码,比如中文注释。
在项目下的build.gradle下添加以下代码即可解决
    tasks.withType(Compile) {
        options.encoding = "UTF-8"
    }

Gradle2.0+环境下需将Compile改为JavaCompile
    tasks.withType(JavaCompile) {
        options.encoding = "UTF-8"
    }


Duplicate files copied in APK META-INF/NOTICE.txt
android {
    packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    }
}

posted @ 2016-05-30 12:08  牧之丨  阅读(4050)  评论(0编辑  收藏  举报