无法在eclipse中渲染地图

时间:2015-11-27 06:47:34

标签: android eclipse google-maps

在我的代码中,我试图在地图上获得当前位置的格子和光度。经度。但是在运行代码的时候,我得到了一个数字和一个当前位置的经度,但无法在eclipse中呈现地图。每次都会生成以下错误。虽然我也生成了API密钥。

11-27 12:09:47.910: E/b(31763): Authentication failed on the server.
11-27 12:09:47.910: E/Google Maps Android API(31763): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
11-27 12:09:47.930: E/Google Maps Android API(31763): In the Google Developer Console (https://console.developers.google.com)
11-27 12:09:47.930: E/Google Maps Android API(31763): Ensure that the "Google Maps Android API v2" is enabled.
11-27 12:09:47.930: E/Google Maps Android API(31763): Ensure that the following Android Key exists:
11-27 12:09:47.930: E/Google Maps Android API(31763):   API Key: AIzaSyBRkcj0dLxxhmjAC6W6TaCoxFo3vCTHQYI
11-27 12:09:47.930: E/Google Maps Android API(31763):   Android Application (<cert_fingerprint>;<package_name>): C9:40:D9:B6:BD:13:27:8A:98:38:29:FD:EA:AC:AF:48:AB:86:FA:E6;com.example.gpstracker

1 个答案:

答案 0 :(得分:0)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blugz.maffy2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="17" />
<permission
android:name="com.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.maps.mapss.permission.MAPS_RECEIVE"/> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission       android:name="com.example.googlemaps.permission.MAPS_RECEIVE" />
 <uses-permission    android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
      <uses-library android:name="com.google.android.maps" />

      <meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="AIzaSyBRkcj0dLxxhmjAC6W6TaCoxFo3vCTHQYI"/>

      <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
   <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

     </application>

      </manifest>'

/ 在您的清单上添加此内容,并确保添加了 google-play-service_lib 。在你的项目作为图书馆