Google Map Android Api V2 Sample Code not working

后端 未结 8 1463
生来不讨喜
生来不讨喜 2020-12-09 11:19

I had tried to use the Google Map Sample Code before which was provided in Google_Play_SERVICE/SAMPLE by using all the available options and it showed the below

相关标签:
8条回答
  • 2020-12-09 12:03

    I have compiled your code and I get maps working. I think I discovered the problem: wrong credentials got cached.

    The first time I ran your code, it was using wrong credentials. Although I have fixed them, I was still getting the "authorization failure" error. Then I simply uninstalled the app, ran it again and then maps got working.

    Apparently Google Maps credentials are cached somewhere. Simpling running the app again does not overwrite them.

    That also explains why I only got maps working after running my other app using Debug As (not Run As)...

    I had the same problem as you and I got maps working only when running the application on a real device through "Debug As > Android Application".

    I'm a newbie in Android development. I don't know if this is just the way things are or we are missing something :)

    0 讨论(0)
  • 2020-12-09 12:07

    Please see already posted answer on SO, it will definitely help you..

    Need to import project from \extras\google\google_play_services\libproject\google-play-services_lib

    Update :

    Make sure your device have Google Play Services apk installed and its version should be > 2
    

    Let me know if it works for you..

    0 讨论(0)
提交回复
热议问题