0

I have looked everywhere on Google for this have been advised to check the file app\src\debug\res\values\google_maps_api.xml which may be corrupt. Problem is how to I find it in Android Studio? I have Android selected (top left) but it is not in the drop-down table there.

lidkxx
  • 2,731
  • 2
  • 25
  • 44
Archdeacon
  • 193
  • 1
  • 4
  • 15

2 Answers2

0

While getting the api key from google map api you have entered the release key/sha1, that's how they are identifying your application, try to generate another key with debug key/sha1 and then try to debug the application but then you will not be able to get results on release key.

Nikhil Jadhav
  • 1,621
  • 2
  • 12
  • 19
  • I can upload a screenshot of the dropdown list if somebody can tell me how to do it; but there is no relevant file in the Project list. At the moment I debug the app in release mode by using _Build > Generate signed apk_ and then _adb install_ on the device. – Archdeacon Aug 23 '17 at 08:03
  • I successfully generated another _debug_ key and all now works; so where was the bug? – Archdeacon Aug 25 '17 at 06:18
  • bug was in your key, as you are debuging the application but you were using the production/release key for the same so at map side it was just a mismatch to identify your application. – Nikhil Jadhav Aug 25 '17 at 09:31
0

First of all, try not to use the "Android" view. Don't know how to better explain it other that "it doesn't always show you all there is". "Project" view is much better. You toggle it either by clicking in the top left where currently Android and selecting it from the list, or from keyboard with CMD + 1 or CTRL + 1.

But you don't have to manually look for a specific file. Press SHIFT key two times and write the file name you're looking for in the field that pops up. That's much faster.

lidkxx
  • 2,731
  • 2
  • 25
  • 44
  • Thanks. Did all that and the response is _nothing to show_; so where is it? – Archdeacon Aug 23 '17 at 08:17
  • Well that should be automatically created for you by AS if you followed Getting Started With Google Maps API guide here https://developers.google.com/maps/documentation/android-api/start If it's not there it means maybe you did something wrong or omitted some step. – lidkxx Aug 23 '17 at 08:22
  • This project was created ages ago so maybe that option was not then available. Finally, if I regenerate the failed DEBUG Api key on Google Console, will the Release Key still work? – Archdeacon Aug 23 '17 at 11:29
  • I don't believe you need separate keys for that. You can use one for both debug and release, check the accepted answer here https://stackoverflow.com/questions/17141008/android-automatically-choose-debug-release-maps-v2-api-key So, to answer your question - if you successfully regenerate debug key you can as well use it for release. Good luck! – lidkxx Aug 23 '17 at 13:06