1.gradle打包,自定义apk名称代码报错(Cannot set the value of read-only property 'outputFile' )
解决 :修改文件名代码请这样写
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "xinlebao_${defaultConfig.versionName}_${releaseTime()}.apk"
}
}
2. AAPT2 编译报错 AAPT2 error
解决:在gradle.properties中关闭APPT2 编译
android.enableAapt2=false
3.apt插件问题(Error:Cannot choose between the following configurations of project :mylibrary:)
解决
//1.在project的build.gradle中删除classpath'com.neenbedankt.gradle.plugins:android-apt:1.8'//2.在module的build.gradle中删除apply plugin:'android-apt'//3.将module的build.gradle文件中的dependencyapt'com.jakewharton:butterknife-compiler:8.1.0'//改为annotationProcessor'com.jakewharton:butterknife-compiler:8.1.0'
其他使用apt的依赖,也要这样更改
网友评论