android-productflavors

Gradle: add dependency for a specific flavour of the library

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 07:12:53
I have a library project and a application. I'd like to have 2 product flavours ( store , dev ) for both library and application. When I build the store flavour for the application I want to use the store flavour from the library. Also when I build the dev flavour for the application I want to use the dev flavour from the library. I tried setting the same product flavours for both library and application but it does not work. Here is my configuration: Library apply plugin: 'android-library' android { compileSdkVersion 19 buildToolsVersion "19.1.0" defaultConfig { applicationId "ro.amarkovits

Localizing string resources added via build.gradle using “resValue”

旧巷老猫 提交于 2019-11-27 02:15:27
问题 This is in continuation to an answer which helped me on this post We can add the string resource as follows from build.gradle : productFlavors { main{ resValue "string", "app_name", "InTouch Messenger" } googlePlay{ resValue "string", "app_name", "InTouch Messenger: GPE Edition" } } It works like a charm and serves the purpose of having different app names per flavor. (with the original app_name string resource deleted from strings.xml file. But, how do we add localized strings for this

How to apply plugin to only one flavor in gradle?

心已入冬 提交于 2019-11-27 01:13:54
问题 I have a multi-flavored, multi-build-typed android project and I want to integrate the NewRelic plugin. But I have to apply it only for one of the customers, thus only for one product flavor. NewRelic uses instrumentation and the plugin would generate code in other flavors if I applied the plugin there, and that is not permitted for us. So my question is: How can I use the apply plugin: something command in the gradle file to be applied to only one of my flavors? 回答1: Use this code: if (

Multiple dex files define <my package>/BuildConfig, can&#39;t find the cause:

时光怂恿深爱的人放手 提交于 2019-11-26 14:15:22
问题 I'm using the new gradle build system and I'm facing the following problem: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/kibo/mobi/BuildConfig; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) at com.android.dx.merge

Gradle: add dependency for a specific flavour of the library

末鹿安然 提交于 2019-11-26 13:04:41
问题 I have a library project and a application. I\'d like to have 2 product flavours ( store , dev ) for both library and application. When I build the store flavour for the application I want to use the store flavour from the library. Also when I build the dev flavour for the application I want to use the dev flavour from the library. I tried setting the same product flavours for both library and application but it does not work. Here is my configuration: Library apply plugin: \'android-library\

No matching client found for package name (Google Analytics) - multiple productFlavors & buildTypes [closed]

橙三吉。 提交于 2019-11-26 12:05:29
Context: I'm trying to set up Google Analytics for my app. (having 4 custom buildTypes and more than a few productFlavors ) It works fine when I select the Build Variant which has the applicationId set to com.my.app.package.name (the package name used when generating the google-services.json ). But, my other flavors have different applicationIds. I followed the offical devguide to set it up. Error I get when any another build variant is selected in Build Variants Tab (which has a different applicationId (package name) is as follows: Error:Execution failed for task ':app

No matching client found for package name (Google Analytics) - multiple productFlavors & buildTypes [closed]

女生的网名这么多〃 提交于 2019-11-26 02:28:19
问题 Context: I\'m trying to set up Google Analytics for my app. (having 4 custom buildTypes and more than a few productFlavors ) It works fine when I select the Build Variant which has the applicationId set to com.my.app.package.name (the package name used when generating the google-services.json ). But, my other flavors have different applicationIds. I followed the offical devguide to set it up. Error I get when any another build variant is selected in Build Variants Tab (which has a different