android - Gradle buildConfigField BuildConfig cannot resolve symbol -
i using gradle build android application. trying use flags based on build type (release or debug).
my gradle file looks this:
android { buildtypes { debug { buildconfigfield 'boolean', 'preprod', 'true' buildconfigfield 'boolean', 'staging', 'false' } release { buildconfigfield 'boolean', 'preprod', 'false' buildconfigfield 'boolean', 'staging', 'false' } } }
and if try call buildconfig.preprod
or buildconfig.staging
"cannot resolve symbol" error. gradle sync successful, don't know if forgot steps in order able use feature?
the generated buildconfig.java
file following (in build/source/buildconfig/debug/com.example.myapp
):
package com.example.myapp; public final class buildconfig { public static final boolean debug = boolean.parseboolean("true"); public static final string package_name = "com.example.myapp"; public static final string build_type = "debug"; public static final string flavor = ""; public static final int version_code = 400; public static final string version_name = ""; }
i getting same bug. try click on synchronize, on right side of save. after gradle sync.
Comments
Post a Comment