-5

我无法从谷歌网站运行示例谷歌地图应用程序。我按照说明操作并添加了我自己的 API 密钥。但仍然无法正常工作。帮助请

这是我刚刚更改 API 密钥的清单

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mapdemo"
    android:versionCode="1"
    android:versionName="1.0" >

    <permission
        android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />
    <!-- Copied from Google Maps Library/AndroidManifest.xml. -->
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <!-- External storage for caching. -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!-- My Location -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <!-- Maps API needs OpenGL ES 2.0. -->
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />
    <!-- End of copy. -->
    <application
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/demo_title" >

        <!-- You must insert your own Google Maps for Android API v2 key in here. -->
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="Here I put my API key" />

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".BasicMapActivity"
            android:label="@string/basic_map" />
        <activity
            android:name=".CameraDemoActivity"
            android:label="@string/camera_demo" />
        <activity
            android:name=".EventsDemoActivity"
            android:label="@string/events_demo" />
        <activity
            android:name=".GroundOverlayDemoActivity"
            android:label="@string/groundoverlay_demo" />
        <activity
            android:name=".LayersDemoActivity"
            android:label="@string/layers_demo" />
        <activity
            android:name=".LocationSourceDemoActivity"
            android:label="@string/locationsource_demo" />
        <activity
            android:name=".MarkerDemoActivity"
            android:label="@string/marker_demo" />
        <activity
            android:name=".OptionsDemoActivity"
            android:label="@string/options_demo" />
        <activity
            android:name=".PolygonDemoActivity"
            android:label="@string/polygon_demo" />
        <activity
            android:name=".PolylineDemoActivity"
            android:label="@string/polyline_demo" />
        <activity
            android:name=".ProgrammaticDemoActivity"
            android:label="@string/programmatic_demo" />
        <activity
            android:name=".TileOverlayDemoActivity"
            android:label="@string/tile_overlay_demo" />
        <activity
            android:name=".UiSettingsDemoActivity"
            android:label="@string/uisettings_demo" />
        <activity
            android:name=".RawMapViewDemoActivity"
            android:label="@string/raw_mapview_demo" />
        <activity
            android:name=".RetainMapActivity"
            android:label="@string/retain_map" />
        <activity
            android:name=".MultiMapDemoActivity"
            android:label="@string/multi_map_demo" />
    </application>
    </manifest>
4

1 回答 1

0

在清单文件的应用程序中包含 android google maps 的库

  <uses-library android:required="true" android:name="com.google.android.maps" />
于 2013-02-11T10:40:38.330 回答