Android - Failed to find provider info for com.google.settings in MapView Example

后端 未结 5 1927
面向向阳花
面向向阳花 2021-02-13 12:15

I\'m trying to implement the MapView example which is defined in Android Hello Views example but now I\'m facing this error:

Failed to find provider info for com         


        
5条回答
  •  孤独总比滥情好
    2021-02-13 13:01

    The MapView example doesn't set API key by default. So you must set it. Here is step by step:

    1. Get MD5 from your system

      %JAVA_HOME%\bin\keytool.exe -list -alias androiddebugkey -keystore "%userprofile%\.android\debug.keystore" -storepass android -keypass android
      
    2. Get API key by pasting the generated MD5 to this page:
      http://code.google.com/android/maps-api-signup.html

    3. Paste the generated API key to {your_project_root}/res/layout/map.xml

      
      
    4. In AndroidManifest.xml, make sure that you have the folowing tag into your application tag:

      
      

      and also the folowing tag into your manifest tag:

      
      
    5. Refresh your project and run

    Note:

    • The path of keytool.exe, debug.keystore and map.xml may differ on your system.
    • If you publish your app, be sure to register another API key.
    • If you don't set API key properly, your app will fail on phone and the error message probably is "... has stopped unexpectedly. Please try again. - Force close"

    More detail at http://d.android.com/guide/tutorials/views/hello-mapview.html

提交回复
热议问题