Error:(47, 0) Could not get unknown property 'IS_CI_BUILD' for object of type com.android.build.gradle.AppExtension -


after performing rm -rf ~/.gradle , rm -rf ~/.gradle/wrapper/dists (needed in order prevent app applying cached versions of third-party library) can no longer build app, line

buildtypes.each {     it.buildconfigfield 'boolean', 'is_ci_build', is_ci_build } 

leads error:

error:(47, 0) not unknown property 'is_ci_build' object of type com.android.build.gradle.appextension. 

what possibly reason? this answer infered is_ci_build property should boolean, whenever change true or false , try run app, edit configuration dialog pops in not sure do.

hmm, turns out problematic build.gradle line needs this:

 buildtypes.each {         it.buildconfigfield 'boolean', 'is_ci_build', 'boolean.parseboolean("true")'     } 

i opened generated buildconfig class , noticed there 2 ways gradle generates these static variables, either literals this: public static final boolean fabricenabled = true; or this: public static final boolean debug = boolean.parseboolean("true"); (more info here).

my is_ci_build wasn't there, figured reason cannot generate buildconfig class , decided give second method try. worked!


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -