I am building a new app for maps. After the creation of new project, Android studio is expecting the definition of properties in local.properties file , but I don’t know how to define a property. So, please help me with this issue.
the instruction is as follows.
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow the directions here:
https://developers.google.com/maps/documentation/android-sdk/get-api-key
Once you have your API key (it starts with "AIza"), define a new property in your
project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the
"YOUR_API_KEY" string in this file with "${MAPS_API_KEY}".
2
Answers
If you want to define a property with a key sdk.dir then put this it in a local.properties like this
sdk.dir=C:Program Files (x86)Androidandroid-studiosdk
And for using this properties in other area you can use this code snippet
Use project.rootProject if you are reading the properties file in a sub-project build.gradle otherwise use
After getting your API Key from google do the following:
Change the Project navigation type from (Android) to (Project)
locate local.properties