Error problem on android studio upgrade automatically output after 3.0 apk name
My installation of the road, and bug wits! ! ! !
Upgrade to 3.0.1 gradle time, app.gradle reported the following faults Error: The main is to replace the previous output.outputFile is outputFileName.
The first case:
Could not get unknown property 'outputFile' for BuildType_Decorated{name=output, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true,
The second case:
Ambiguous method overloading for method java.io.File# . Cannot resolve which method to invoke for [class java.lang.String, null] due to overlapping prototypes between: [class java.lang.String, class java.lang.String] [class java.lang.String, class java.io.File] Open File
The third case:
No signature of method: java.util.ArrayList.endsWith() is applicable for argument types: (java.lang.String) values: [.apk] Open File
Anyway, no matter what kind of error, and finally through to read each blog information, and their attempt to modify the following scheme is finally it. :
//自定义打包时apk名字
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
def fileName
if (outputFileName != null && outputFileName.contains('.apk')) {
if (variant.buildType.name.equals('release')) {
//输出示例: yilv-huawei-release.apk
fileName = "yilv-${variant.productFlavors[0].name}-${defaultConfig.versionName}-relese.apk"
} else if (variant.buildType.name.equals('debug')) {
fileName = "yilv-${variant.productFlavors[0].name}-${defaultConfig.versionName}-debug.apk"
}
outputFileName = fileName
}
}
}
//渠道
productFlavors {
develop {}
xiaomi {}
huawei {}
}
---------------------
Disclaimer: This article is CSDN blogger "runaway bear two" original article, follow the CC 4.0 by-sa copyright agreements, please attach a reprint the original source link and this statement.
Original link: https: //blog.csdn.net/sunchaohui5741/article/details/80499547
Intel HAXM is required to run this AVD.
7 link address
https://jingyan.baidu.com/article/a3761b2be09f961576f9aab3.html
AndroidStudio Gradle 解决Error:All flavors must now belong to a named flavor dimension. Learn more at
link address:
https://blog.csdn.net/jabony/article/details/78932024