A
A
Andrey Myvrenik2016-11-18 16:10:47
Android
Andrey Myvrenik, 2016-11-18 16:10:47

How to use different "applicationId" for debug and release builds?

Is it possible to build one Android project with different applicationId values ​​depending on the type without having to manually change something every time? The fact is that the analytics and error reporting in Firebase logs a lot of unnecessary things during development and, as a result, spoils the statistics.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Myvrenik, 2016-11-18
@gim0

Found a way: https://developer.android.com/studio/build/index.html

productFlavors {
    free {
      applicationId 'com.example.myapp.free'
    }

    paid {
      applicationId 'com.example.myapp.paid'
    }
}

As an alternative, you can use suffixes:
android {
    buildTypes {
        debug {
            applicationIdSuffix '.debug'
            versionNameSuffix '-DEBUG'
        }

        release {
            // ...
        }
    }
}

Taken from here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question