I am implementing flavors in my app. I set them like this:
flavorDimensions "default"
productFlavors {
production {
dimension "default"
buildConfigField "string", "BASE_URL", "https://example.dev.com;"
}
dev {
dimension "default"
buildConfigField "string", "BASE_URL", "https://example.prod.com"
versionNameSuffix "-dev"
}
}
and I want to access BASE_URL
in my code, but I don’t really know how and I am struggling to find answer.
I tried to use BuildConfig.BASE_URL
but I can’t use it as IDE saying it’s undefined name
.