I'm trying to understand how i can generate multiple APK from one single project.
I'm using gradle and this is my project's three:
It's work. Now i'm able to generate multiple APK. (just one at the moment) One apk for each module.
The problem is that i need to manually sync all the AndroidManifest.xml for every future module that i'll include in my project.
Is this the correct way? Can i automate this operation?
I took a look at productFlavor . Just I don't understand if this tool can help me.
What do you think about?
THANK YOU ALL!
Finally! I found the same solution proposed by @Kai!
Flavor is the way!
This is the best approach for a lots of reasons:
http://www.techotopia.com/index.php/An_Android_Studio_Gradle_Build_Variants_Example
If by " one single source core and multiple project that extends "ProductName", "PackageName" and "resources" " you mean to provide each flavor with unique "ProductName", "PackageName" and "resources", then yes it can be done.
To give each flavor its own unique package, set applicationId
for each of your flavors like so:
android {
productFlavors {
flavor_1 {
applicationId = 'com.app.flavor_1'
}
flavor_2 {
applicationId = 'com.app.flavor_2'
}
}
}
To give each flavor its own app name and resources, simply put them in a flavor's own directory, Gralde will merge a flavor's resources with your base resources to create a complete one.
For more detail on how Gralde flavors work, please see Gradle Plugin User Guide
This is my final solution!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.