谷歌地图api v2空白屏幕

时间:2016-03-30 16:57:27

标签: android google-maps

我知道这个问题被问了几十次,但我仍然无法解决问题 这是我的清单文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="chatapps.tutorial.com.fatimaarshad_assignment2" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <!--
 The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but are recommended.
    -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <permission
        android:name="chatapps.tutorial.com.fatimaarshad_assignment2.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>


    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <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>

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

        <activity
            android:name=".MapsActivity"
            android:label="@string/title_activity_maps" >
        </activity>

    </application>

</manifest>

这是我的google_maps_api.xml

<resources>
    <!--
    TODO: Before you run your application, you need a Google Maps API key.

    To get one, follow this link, follow the directions and press "Create" at the end:

https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=FC:78:21:3D:9E:21:BA:03:0E:0E:E0:C9:7D:C7:65:45:A4:9D:DA:8B%3Bchatapps.tutorial.com.fatimaarshad_assignment2

    You can also add your credentials to an existing key, using this line:
    FC:78:21:3D:9E:21:BA:03:0E:0E:E0:C9:7D:C7:65:45:A4:9D:DA:8B;chatapps.tutorial.com.fatimaarshad_assignment2

    Once you have your key (it starts with "AIza"), replace the "google_maps_key"
    string in this file.
    -->
    <string name="google_maps_key" translatable="false" templateMergeStrategy="preserve">
     AIzaSyCshw8btydSGdry5SqJOgX7vdojQnMvv-Q
    </string>
</resources>

我已经添加了所有权限和api密钥,两次更改了api密钥但它仍然无法正常工作。它之前确实有效,但它不再起作用了。

0 个答案:

没有答案