Status Update
Comments
mt...@gmail.com <mt...@gmail.com> #2
We use build flavours heavily with a lot of common code. The refactoring support in AS is really good but it continually catches us out when it doesn't work across all flavours in a project. It's a big gap for serious product development.
uc...@google.com <uc...@google.com> #3
We at my company need this same feature. We have a lot of white labels and need refactor the same class across flavours. :(
je...@google.com <je...@google.com>
mt...@gmail.com <mt...@gmail.com> #4
I need this feature too...
mt...@gmail.com <mt...@gmail.com> #5
+1, I need this very badly
mt...@gmail.com <mt...@gmail.com> #6
+1 My company also need this feature.
je...@google.com <je...@google.com>
je...@google.com <je...@google.com>
ch...@google.com <ch...@google.com> #7
Can we atleast know the status of the issue please? Will it be fixed or is it in low priority. It's been 4 years.
mt...@gmail.com <mt...@gmail.com> #12
We also need this feature...please...
al...@google.com <al...@google.com> #13
I would like to vote for this feature as well.
mt...@gmail.com <mt...@gmail.com> #14
+1
zc...@gmail.com <zc...@gmail.com> #15
Build flavor source code is useless until this is fixed.
mt...@gmail.com <mt...@gmail.com> #16
+1
Description
Build #AI-162.3742087, built on February 16, 2017
Version of Gradle Plugin: 2.3.0-rc1
Version of Gradle: 3.3
Version of Java: JRE: 1.8.0_112-release-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
OS: Windows 10 x64, Apple OS X
Steps to Reproduce:
def changeApkName = { variant ->
variant.outputs.each { output ->
def apk = output.outputFile;
def branch = gitBranch().replaceAll('/', '-');
def newName = "-${variant.versionName}-${branch}";
newName = apk.name.replace(".apk", "${newName}.apk")
output.outputFile = new File(apk.parentFile, newName);
println 'INFO: Set outputFile to ' + output.outputFile + " for [" +
}
}
def gitSha() {
if (project.hasProperty('git.hash')) {
return project.getProperty('git.hash')
}
return 'git rev-parse --short HEAD'.execute(null, project.rootDir).text.trim()
}
def buildTime() {
return new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"))
}
def gitBranch() {
if (project.hasProperty('git.branch')) {
return project.getProperty('git.branch')
}
return 'git rev-parse --abbrev-ref HEAD'.execute(null, project.rootDir).text.trim()
}
android {
applicationVariants.all { variant ->
variant.outputs.each { output ->
changeApkName(variant)
}
}
}
after create a few branches.
Build apk in one branch.
checkout to another branch.
build.
Current branch: develop
Previous branch: feature/strictMode
In current (develop) branch I get error when try to install apk to phone:
02/23 15:58:00: Launching mobile
The APK file ...\mobile\build\outputs\apk\mobile-dev-debug-4.4.3-SNAPSHOT-feature-strictMode.apk does not exist on disk.
Error while Installing APK
Gradle/AS didn't invalidate filename after build (gradle sync/checkout to branch) and it use previous name from wrong branch.
File which is in mobile/build/output/apk is: mobile-dev-debug-4.4.3-SNAPSHOT-develop.apk.
Whats wrong: adb install obtains wrong file name!
Expected behaviour: install apk from correct location and with corect file name.