I have a project that has multiple modules:
MyProject
module1
module2
I would like to generate the APK for module 2.
module 2 has the following instructions in its build.gradle:
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
output.outputFile = new File("../module1/src/main/assets", "module2.apk")
}
}
As you can see, I would like to build the APK into module1's assets directory.
Android Studio doesn't seem to have a button for this. If it has, could you please point me on how to find and use it. An added bonus would be to show how to go about it in Terminal. I am on Linux (Kali Linux)
Thank you all in advance.
Add Product flavor like this :
productFlavors {
module-1{
applicationId
"pacakage_name.module-1"
versionName "1.0-module-1"
}
module-2{
applicationId
"pacakage_name.module-2"
versionName "1.0-module-2"
}
}
Debug module 2 then it will generate module 2 apk.For more details Build Varient