Gradle buildConfigField BuildConfig cannot resolve symbol Gradle buildConfigField BuildConfig cannot resolve symbol android android

Gradle buildConfigField BuildConfig cannot resolve symbol


Make sure your file is importing the right BuildConfig class. Sometimes if you have other project libraries or modules, it may import the wrong buildConfig.Make sure your import it's like this com.project.app.BuildConfig. I was Having the same issue and the problem was this, Hope it can help somebody.


I was getting the same bug.Try to click on synchronize, on the right side of save.Do that after gradle sync.


Happened to me because I did not declared a String field properly.

I forgot the escaping characters. Changing from :

buildConfigField "String", "FOO", "foo"

to

buildConfigField "String", "FOO", "\"foo\""

solved the problem.