shorebirdtech / docs

The shorebird docs site
https://docs.shorebird.dev
MIT License
9 stars 21 forks source link

`applicationIdSuffix` line could be confusing when setting up flavors #156

Open nilsreichardt opened 11 months ago

nilsreichardt commented 11 months ago

Description

When setting up flavors and you follow the Shorebird docs for Android, the docs mention the following the example:

defaultConfig {
    ...
}

+    flavorDimensions "track"
+    productFlavors {
+        internal {
+            dimension "track"
+            applicationIdSuffix ".internal"
+            manifestPlaceholders = [applicationLabel: "[Internal] Shorebird Example"]
+        }
+        stable {
+            dimension "track"
+            manifestPlaceholders = [applicationLabel: "Shorebird Example"]
+        }
+    }

buildTypes {
  ...
}

However, the line applicationIdSuffix ".internal" is optional and isn't required. I can also break the app if you have something like Firebase set up that depends on the package name.

In Discord, there was a customer who that this issue: https://discord.com/channels/1030243211995791380/1158737883511926784

Possible solution

A possible solution could be to mention that the applicationSuffix line is optional:

defaultConfig {
    ...
}

+    flavorDimensions "track"
+    productFlavors {
+        internal {
+            dimension "track"
+            // The `applicationIdSuffix ".internal"` line is optional and can be omitted.
+            // However, be cautious when using it with services like Firebase, which 
+            // may rely on consistent package names.
+            applicationIdSuffix ".internal"
+            manifestPlaceholders = [applicationLabel: "[Internal] Shorebird Example"]
+        }
+        stable {
+            dimension "track"
+            manifestPlaceholders = [applicationLabel: "Shorebird Example"]
+        }
+    }

buildTypes {
  ...
}
eseidel commented 10 months ago

PRs welcome. :)