diff --git a/src/content/docs/code-push/guides/flavors/android.mdx b/src/content/docs/code-push/guides/flavors/android.mdx index ef73caa0..96eb492b 100644 --- a/src/content/docs/code-push/guides/flavors/android.mdx +++ b/src/content/docs/code-push/guides/flavors/android.mdx @@ -6,6 +6,8 @@ sidebar: order: 21 --- +import { Tabs, TabItem } from '@astrojs/starlight/components'; + This guide will walk through how to setup an app in which there are 2 deployment flavors: `internal` and `stable`. It will cover how to validate a patch on the internal flavor and then promote the patch to the stable flavor on Android. @@ -30,7 +32,40 @@ Create a new project using `flutter create flavors`. ## Configure Flavors -Next, edit the `android/app/build.gradle` to contain two productFlavors: + + + + +Next edit the `android/app/build.gradle.kts` to contain two productFlavors: + +```diff +defaultConfig { + ... +} + ++ flavorDimensions += "track" ++ productFlavors { ++ create("internal") { ++ dimension = "track" ++ applicationIdSuffix = ".internal" ++ manifestPlaceholders["applicationLabel"] = "[Internal] Shorebird Example" ++ } ++ create("stable") { ++ dimension = "track" ++ manifestPlaceholders["applicationLabel"] = "Shorebird Example" ++ } ++ } + +buildTypes { + ... +} +``` + + + + + +Next edit the `android/app/build.gradle` to contain two productFlavors: ```diff defaultConfig { @@ -55,6 +90,9 @@ buildTypes { } ``` + + + Lastly, edit `android/app/src/main/AndroidManifest.xml` to use the `applicationLabel` so that we can differentiate the two apps easily: