2

I am developing in Android, and I have a submodule in my project.

I have set buildConfigField like the following in build.gradle of Module

buildTypes {
    release {
        minifyEnabled false
        buildConfigField "String", "TestId", '"48"'
    }
    dev {
        buildConfigField "String", "TestId", '"88"'
    }
}

And I use TestId in module.

But I want to change the TestId from outside, like build.gradle of app.

How to set the buildConfigField of module from build.gradle of app for Android ?

Thanks in advance.

user11657407
  • 312
  • 2
  • 12
Wun
  • 6,211
  • 11
  • 56
  • 101

1 Answers1

-1

Your question is a little confusing for me. I don't really get your point. But I want to point out. The buildConfigField will generate corresponding field in BuildConfig. And these fields are decorated by final keyword. So they can't be changed.

littlebear333
  • 710
  • 2
  • 6
  • 14