Advanced_Android_Development icon indicating copy to clipboard operation
Advanced_Android_Development copied to clipboard

app/build.gradle correction required

Open mnarasimhan02 opened this issue 8 years ago • 1 comments

in app/build.gradle file

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

needs to be corrected.

The MyOpenWeatherMapApiKey should be specified within '"key"' i.e, '"actual_key"'

This may not not be an issue, but needs comment or correction in the source code else the buildconfig.Java will throw an error

mnarasimhan02 avatar Oct 23 '16 16:10 mnarasimhan02

Alternatively it is possible to define MyOpenWeatherMapApiKey in a gradle.properties file. For details see Chapter 12. The Build Environment in the gradle documentation.

This is how the variable is defined in the gradle.properties file:

MyOpenWeatherMapApiKey="apikey"

This can be in the gradle.properties file in the project or in the user home folder (e.g. C:\Users\Bob\.gradle\gradle.properties on Windows).

I totally agree that there should be a comment or some info in the README file.

skleeschulte avatar Feb 06 '17 00:02 skleeschulte