I am trying to create a google map activity in android studio, but the file google_maps_api.xml
was not created in the res/values folder
(see screenshot). Am I missing something or can I just create the file myself?
o I tried to research why this might happen, but I was unable to determine why google_maps_api.xml
would not be created automatically.
2
Answers
I suppose that
google_maps_api.xml
is just a file with some resources such as strings or integers. So you can just manually add it by yourself in theres/values
folder in your module. And after that add any resources (API keys or something else) in this file.Android Studio underwent some modifications a while back and stopped creating the google_maps_api.xml file automatically. You need to do two things instead:
Open the project’s local.properties file and add the line
MAPS_API_KEY=YOUR_KEY_HERE
, replacing YOUR_KEY_HERE with your API key.Open AndroidManifest.xml file and replace YOUR_API_KEY with
${MAPS_API_KEY}
as shown below.