Could not find property ‘xxxx’ on

I got this error after I added these lines to my gradle file:

buildTypes.each {
        it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', MyOpenWeatherMapApiKey

then the log show:

Could not find property 'MyOpenWeatherMapApiKey' on

The solutions on google that I searched cannot solve my problem. Please show me where I was wrong?

Have you added this line to file

MyOpenWeatherMapApiKey = "your API key"
1 Like

thank you, I forgot this…