問題1:Could not find method leftShift() for arguments
preBuild << {
task.execute()
}
解決方案:去掉build.gradle文本中的<<
問題2:Gradle DSL method not found: 'execute()'
解決方案:目前用task.doFirst方法代替
問題3:Cannot set the value of read-only property 'outputFile'
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
//這里修改apk文件名
def fileName="jianShu-${variant.buildType.name}-${defaultConfig.versionName}.apk"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
解決方案:
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith(‘.apk’)) {
//這里修改apk文件名
def fileName = “jianShu-${variant.buildType.name}-${defaultConfig.versionName}.apk”
output.outputFileName = fileName
}
}
}
問題4:Unable to resolve dependency for ':CoreBusiness@beta/compileClasspath': Could not resolve project :OpenSourceLibrary.
解決方案:所有module下的buildTypes要保持一致
buildTypes {
debug {
...
}
beta {
...
//關(guān)鍵代碼,lib的module下要添加這行代碼
matchingFallbacks = ['release', 'debug']
}
release {
...
}
sourceSets{
}
lintOptions {
}
}
注意:lib的module下buildTypes中的項目可以不填內(nèi)容鹉究,例如:lintOptions{}
問題5:jni生成so的方式改變了峭拘。
解決方案:使用CMake方式來生成so。
問題6:簽名打包需要使用v2Signing。
解決方案:使用美團(tuán)新版打包工具妓布,項目地址:https://github.com/Meituan-Dianping/walle