android-productflavors

INSTALL_FAILED_CONFLICTING_PROVIDER with Facebook SDK when I build multiple productFlavors

核能气质少年 提交于 2019-12-04 04:59:25
I'm building an Android app with multiple productFlavors , and using Facebook SDK v4.1 for login and sharing contents. The problem is that when I try to install an app on a device which already has the same app installed (but different flavor), it raises an error. It doesn't allow me to install the second app unless I uninstall the existing one. <provider android:authorities="com.facebook.app.FacebookContentProvider{my_app_id}" android:name="com.facebook.FacebookContentProvider" android:exported="true"/> According to this document , the android:authorities should be unique and I should have

Equivalent to product flavors in non-Android Gradle?

梦想与她 提交于 2019-12-03 13:50:54
问题 I'm creating a desktop Java app and would like to create two versions: free and paid. The difference is mainly in which resource files are included (at a future date, it may involve different code as well, but not right now). I've read about Android build variants allowing for just this sort of thing through "product flavors". However, this seems to be a feature unique to the android plugin, which is obviously not available on the desktop. Is there an equivalent to these product flavors that

Multi-flavor compile dependencies in gradle

痴心易碎 提交于 2019-12-03 10:20:03
问题 Is there a way to have compile dependencies by multiple flavors in Android Studio (build.gradle)? I have 2 flavorGroups, and in each 2 variants. Out of the 4 possible combinations I would like to be able to depend on a lib only if I'm both in latest and in free flavor. latestCompile or freeCompile works, but latestFreeCompile doesn't. this is the relevant part of my build.gradle: android { defaultConfig { minSdkVersion 7 targetSdkVersion 19 versionCode 15 versionName "1.9." + versionCode }

Error processing / merging manifest

只愿长相守 提交于 2019-12-02 19:09:38
问题 I get this error W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\flavor_customer1Debug\processFlavor_customer1DebugManifest\merged\AndroidManifest.xml:49: error: resource string/MyAppName (aka com.customer1.app:string/MyAppName) not found. error: failed processing manifest. ... My gradle contains this flavor_customer1 { java.srcDirs = ["W:/android-studio-projects/sharedid/app/src/main/java/"] manifest.srcFile "W:/android-studio-projects/sharedid/app/src/customer1

Error processing / merging manifest

守給你的承諾、 提交于 2019-12-02 10:51:53
I get this error W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\flavor_customer1Debug\processFlavor_customer1DebugManifest\merged\AndroidManifest.xml:49: error: resource string/MyAppName (aka com.customer1.app:string/MyAppName) not found. error: failed processing manifest. ... My gradle contains this flavor_customer1 { java.srcDirs = ["W:/android-studio-projects/sharedid/app/src/main/java/"] manifest.srcFile "W:/android-studio-projects/sharedid/app/src/customer1/AndroidManifest.xml" assets.srcDirs = ["W:/android-studio-projects/sharedid/app/src/customer1/assets/"]

Robotium - testing specific flavors in Android Studio with Gradle

此生再无相见时 提交于 2019-12-02 09:56:58
So... i'm trying to make some tests for my application. I have several flavors in my application, and I want to build individual tests for each flavor. From the Robotium documentation I used the "androidTest/java" folder with a package inside... I event tried after some suggestions to input a flavor's .test. Another suggestion from here: http://tools.android.com/tech-docs/new-build-system/user-guide was to make several folders named "androidTest", but it didn't worked. I have the latest Android Studio with Gradle 2.2.1. I want to start 1 test to run for a single flavor. Currently in all the

Android gradle: Sharing dependencies between product flavors

馋奶兔 提交于 2019-12-02 04:52:22
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 each flavor. android { productFlavors { flavor1 {} flavor2 {} flavor3 {} } sourceSets { main {} flavor1

Localization within product flavors

瘦欲@ 提交于 2019-12-02 04:24:56
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 flav3Release/ res/ values/strings.xml Each product flavor is already overriding the default strings.xml.

Is there a way to change gradle variable value based on selected productFlavor?

喜你入骨 提交于 2019-12-02 00:37:30
问题 Below is my gradle example: I want to change STORE_FILE_PATH value dynamically based on selected productFlavors. Currently STORE_FILE_PATH is always overwriting it's value with last defined productFlavor. (In my case it always becomes "/pro.jks") Help me find solution. Thanks def STORE_FILE_PATH = ""; android { productFlavors { free { versionCode 1 versionName "1.0.0" applicationId "com.example.free" buildConfigField "boolean", "IS_AD_ENABLED", "true" STORE_FILE_PATH = "/free.jks" } pro {

Single flavor module based on multi flavor library in Gradle

被刻印的时光 ゝ 提交于 2019-12-01 15:37:25
I'm working on a multi-flavor app . (gradle files below) It uses a library called tracker that follow the same flavors internal and external Now for the tricky part, come a new module called feature , this one has no flavor but it needs the tracker as dependency app.gradle: android { buildTypes { debug { } release { } } flavorDimensions "target" productFlavors { internal { dimension "target" } external { dimension "target" } } } tracker.gradle: android { publishNonDefault true buildTypes { release { } debug { } } flavorDimensions 'target' productFlavors { internal { dimension "target" }