This is the full text of the error:-
Error:(21, 0) Gradle DSL method not found: 'buildConfigField()'
Possible causes:
The project 'Sunshine2' may be using a version of Gradle that does not contain the method. Gradle settings The build file may be missing a Gradle plugin. Apply Gradle plugin
I'm using gradle 2.4 with Android Studio 1.4. I don't know what is causing the problem or how to fix it. A little help please.
The line of code calling the BuildConfig was missing a comma:
buildTypes.each {
it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY' 'MyOpenWeatherAPIKey'
}
It now reads like this:
buildTypes.each {
it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', 'MyOpenWeatherAPIKey'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With