Skip to content

applicationIdSuffix line could be confusing when setting up flavors #156

@nilsreichardt

Description

@nilsreichardt

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 {
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions