I am trying to configure with Gradle a project which contains some external libraries. With Gradle I can setup different Environmental Configuration (with a class inside a c
Not sure what's wrong with your configuration but about your need, I would do it differently.
In the gradle build file you can use the buildConfig keyword to add a specific line to the BuildConfig.java generated class.
So you could add do something like that in your build.gradle :
release {
buildConfig "public static final String USE_REPORTING = true;"
}
debug {
buildConfig "public static final String USE_REPORTING = false;"
}
And so have only one PlayerEnvConfig with
public static final boolean USE_REPORTING = BuildConfig.USE_REPORTING;
Or even no more PlayerEnvConfig and use directly the BuildConfig class.
EDIT Since an update, the syntax has changed :
buildConfigField "", "", ""