android-productflavors

Does Android Studio support sub-flavors?

痞子三分冷 提交于 2020-01-13 17:10:35
问题 I have an Android Studio project that currently has 2 product flavors in the build.gradle as follows: productFlavors { parent { applicationId "xxx.parent" } teacher { applicationId "xxx.teacher" } } Both flavors have some common code under src/main What I need is 1 more level of flavors, so I want under one flavor to have sub flavors which is 1 more level of customization (for some resources & some static variables) So I want something similar to below: productFlavors { parent { p1 {

Does Android Studio support sub-flavors?

你。 提交于 2020-01-13 17:09:31
问题 I have an Android Studio project that currently has 2 product flavors in the build.gradle as follows: productFlavors { parent { applicationId "xxx.parent" } teacher { applicationId "xxx.teacher" } } Both flavors have some common code under src/main What I need is 1 more level of flavors, so I want under one flavor to have sub flavors which is 1 more level of customization (for some resources & some static variables) So I want something similar to below: productFlavors { parent { p1 {

Android annotations and flavors in Android Studio 1.0.1

寵の児 提交于 2020-01-05 12:29:12
问题 i'm trying to add two flavors in my project, I already have android annotations and it's working fine without the favors, but when I'm adding the two favors the MainActivity_ class is generated only for one of the flavors when changeing the build variant. Any ideas on how could you add flavors and still use the annotations? Android annotations version is '3.2' My android section in gradle looks like this android { compileSdkVersion 21 buildToolsVersion "21.1.2" packagingOptions { exclude

How to get Running Android Flavor Name in gradle script

北战南征 提交于 2020-01-04 05:40:06
问题 This time I have this problem, I am trying to get the current flavor in a gradle script. I have tried the answers given here How to get current flavor in gradle without luck. I haven seen in some answers that they use // Get all flavors android.productFlavors.all { flavor -> if (flavor.name.equals("flavorName")) { // do what you like } // ... } But also I didn't have any luck with that because i get the following error: > Could not get unknown property 'android' for task So I don't know how

Product flavour [Migrating from eclipse to android studio]

这一生的挚爱 提交于 2020-01-03 00:00:33
问题 I have migrated my app from eclipse to android studio, and now I was attempting to run product flavours. I have been following the blog at http://blog.robustastudio.com/mobile-development/android/building-multiple-editions-of-android-app-gradle/ Following is my build structure when imported from eclipse. I am able to see the variants in the build variants window. Following is the build.gradle apply plugin: 'com.android.application' dependencies { compile fileTree(dir: 'libs', include: '*.jar'

Android gradle: Sharing dependencies between product flavors

陌路散爱 提交于 2019-12-31 04:01:10
问题 I have 3 product flavors (flavor1, flavor2, flavor3) in my app. flavor1 and flavor2 share some of the dependencies related to ads. Is there a way to bundle the ad related dependencies to a gradle dimension or configuration and add that to flavor1 and flavor2 without duplicating the compileFlavor1 and compileFlavor2 lines in my build.gradle? This is part of my current gradle. This works. But, I'm wondering if there is a better way to do this? So, I don't have to repeat the ad dependencies for

Localization within product flavors

孤人 提交于 2019-12-31 03:58:10
问题 I have 3 product flavors, debug and release for each flavor, each of which I have successfully given each unique strings and icons. Now I am preparing for Localization, which requires different strings for each product flavor. Here's my current folder/directory setup: myApp/ src/ main/ res/ values/strings.xml flav1Debug/ res/ values/strings.xml flav1Release/ res/ values/strings.xml flav2Debug/ res/ values/strings.xml flav2Release/ res/ values/strings.xml flav3Debug/ res/ values/strings.xml

Android wear project with 3 flavors, 3 buildTypes and 2 applicationIdSuffixes

允我心安 提交于 2019-12-30 03:45:47
问题 When I build my project after trying to combine wearApp flavors and buildTypes with applicationIdSuffixes, i get the following error message: Error:Execution failed for task ':app:handleFirstCustomerTestMicroApk'. > The main and the micro apps do not have the same package name. From my app/build.gradle: buildTypes { debug { applicationIdSuffix '.debug' debuggable true embedMicroApp = true } customerTest { applicationIdSuffix '.customertest' debuggable true embedMicroApp = true } release {

Grouping few of many sourceSets having exactly same configuration

亡梦爱人 提交于 2019-12-29 07:51:33
问题 Lets say I have the following sourceSets : sourceSets { flavor1 { assets.srcDirs = ['repo-assets/flavor1'] res.srcDirs = ['repo-res/flavor1'] } flavor2 { assets.srcDirs = ['repo-assets/flavor2'] res.srcDirs = ['repo-res/flavor2'] } flavor3 { assets.srcDirs = ['repo-assets/flavor1'] res.srcDirs = ['repo-res/flavor1'] } flavor4 { assets.srcDirs = ['repo-assets/flavor2'] res.srcDirs = ['repo-res/flavor2'] } } If you notice flavor1 and flavor3 have same srcDirs and so does flavor2 and flavor4 .

NDK support with different Product Flavour

北慕城南 提交于 2019-12-29 07:42:20
问题 I want different string value from ndk library. as i have two flavor demo and live I want value "hello I am from demo " for demo flavor and for live flavor i want "hello I am from live " Here is my java file code public class MainActivity extends AppCompatActivity { // Used to load the 'native-lib' library on application startup. static { System.loadLibrary("native-lib"); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R