I am on android gradle plugin version 8.3.2
. I am trying to configure different constants for my release and dev builds. I am not using productFlavors because this doesn’t change the behavriour of the app. Below is my build types section
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders["appName"] = "Foo"
buildConfigFields "String" "MY_TOKEN" "${myTokenRelease}"
}
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
manifestPlaceholders["appName"] = "FooDebug"
buildConfigField "String" "MY_TOKEN" "${myTokenDebug}"
}
}
I tried clean build, invalidate caches and restart, but I get the error
Gradle DSL method not found: buildConfigField()
What is the solution for this? I would like to try “buildConfigFields” which takes a Map<String, ClassField>
as a parameter. I am not sure how to construct a ClassField
.