android-flavors

when to use android flavours vs separate projects

前提是你 提交于 2021-02-08 06:44:54
问题 I have been doing some reading on Android flavours and how to use them in SO and other resources such as 1)Building Multiple Editions of an Android App with Gradle 2)Building multiple flavours of an Android app based on these examples, android flavours are very useful for building multiple editions of the app. but my question is: Is it a good practice to use flavours in scenarios that service provider and consumer roles have separate app like uber or it is better to build separate projects.

ViewBinding - Different Flavor Layout Resource

白昼怎懂夜的黑 提交于 2020-03-23 08:00:10
问题 I have a flavor which contains the same layout resource that is in my main source set. This is so it overrides the main one with the flavor specific one. I have done this in many places and it works fine until I introduced ViewBinding . For accuracy, the layout is a nested layout that is "included" in a fragment. Here is the structure: main - res - - layout - - - layout_sign_up_details_fields.xml flavor - res - - layout - - - layout_sign_up_details_fields.xml I have a view, whose ID is til

Android Studio build flavors - How to have same source files in diverse flavors

北战南征 提交于 2019-12-30 02:03:05
问题 I need to create a demo flavor in android studio for an app. In my app level gradle file i have created another flavor called demo and the default flavor of full of course. It looks like this: apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.example.uen229.myapplication" minSdkVersion 17 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles

java.lang.IllegalArgumentException: Failed to find configured root that contains “insert app directory path here”

大兔子大兔子 提交于 2019-12-11 07:02:07
问题 I am opening the camera to capture a image and i followed this tutorial. Error stated in the title comes when i tried to create different flavor builds configuration for my app. This is my meta data xml resource file named file_paths for File Provider path configuration - <?xml version="1.0" encoding="utf-8"?> <paths xmlns:android="http://schemas.android.com/apk/res/android"> <external-path name="my_images" path="@string/images_file_path"/> </paths> I am setting it in manifest as follows -

How to hide or add menu items for Flavor?

做~自己de王妃 提交于 2019-12-10 18:19:40
问题 I have an app that has 3 different flavors, full , part1 and part2 . All different flavors have different package names, so I can ship them as different apps. Now I want that only part1 gets a menu item called Reload . The other 2 flavors shouldn't have this menu item. Is this possible? I tried the following with the menu resources: app | +-src | +-full | +-main | | | +-res | | | +-menu | | | +-main_activity.xml | +-part1 | | | +-res | | | +-menu | | | +-main_activity.xml | +-part2 Where main

manifestPlaceholders value is not string

亡梦爱人 提交于 2019-12-06 11:47:37
问题 In my AndroidManifest.xml file I have the following meta-data tag which should be populated dynamically: <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="${FACEBOOK_APP_ID}"/> My gradle file looks like this: manifestPlaceholders = [ GOOGLE_PROJECT_ID: "A888844613784", FACEBOOK_APP_ID: "888570042741264" ] After "Build & Assemble" the FACEBOOK_APP_ID in the manifest file looks like this: <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="1481023616

manifestPlaceholders value is not string

别说谁变了你拦得住时间么 提交于 2019-12-04 15:38:10
In my AndroidManifest.xml file I have the following meta-data tag which should be populated dynamically: <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="${FACEBOOK_APP_ID}"/> My gradle file looks like this: manifestPlaceholders = [ GOOGLE_PROJECT_ID: "A888844613784", FACEBOOK_APP_ID: "888570042741264" ] After "Build & Assemble" the FACEBOOK_APP_ID in the manifest file looks like this: <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="1481023616.000000" /> Unfortunately this is not a String, but a float value. That's not correct or what I want. I

Gradle Warnings: Could not find google-services.json while looking in [duplicate]

試著忘記壹切 提交于 2019-11-29 05:30:29
This question already has an answer here: google-services.json for different productFlavors 23 answers I got the following warnings. How can I avoid this warnings? Could not find google-services.json while looking in [src/flavor1/debug, src/debug, src/flavor1] Could not find google-services.json while looking in [src/flavor1/release, src/release, src/flavor1] Could not find google-services.json while looking in [src/flavor2/debug, src/debug, src/flavor2] Could not find google-services.json while looking in [src/flavor2/release, src/release, src/flavor2] I added two client_info at app/google

Gradle Warnings: Could not find google-services.json while looking in [duplicate]

可紊 提交于 2019-11-27 23:00:55
问题 This question already has answers here : google-services.json for different productFlavors (24 answers) Closed last year . I got the following warnings. How can I avoid this warnings? Could not find google-services.json while looking in [src/flavor1/debug, src/debug, src/flavor1] Could not find google-services.json while looking in [src/flavor1/release, src/release, src/flavor1] Could not find google-services.json while looking in [src/flavor2/debug, src/debug, src/flavor2] Could not find