0

For debugging purposes - I want to have multiple builds of my flutter app. One - should be from google play and few others like "App Name - Dev" Or "App Name - STG". I tried to use flavors and modifying android:label="@string/app_name" however I cant install new build of app - android complains with following message - app not installed as package conflicts with an existing package

So how do I have multiple builds of same app on my device?

1 Answer 1

1

In device or playstore , app is identified by bundle id and as per error it looks like you are trying to install app with same bundle id which is already installed on device . To make same app different, you need to make bundle id different which you can achieve by flavours . Kindly consider below mentioned code

android {
    defaultConfig {
        applicationId "com.example.myapp"
    }
    productFlavors {
        free {
            applicationIdSuffix ".free"
        }
        pro {
            applicationIdSuffix ".pro"
        }
    }
}

here we have two flavours

  1. free
  2. pro

now both will have different bundle id as applicationIdSuffix will append string at the end of original bundle id

So for free flavour , it will be com.example.myapp.free and for pro flavour , it will be com.example.myapp.pro

For more details , you can check this link

https://developer.android.com/build/build-variants#groovy

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks bud, that seems to be what Im looking for!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.