資源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'
}
}
