Android Studio谷歌地图没有';不显示地图

Android Studio谷歌地图没有';不显示地图,android,google-maps,Android,Google Maps,我试图在android studio中使用谷歌地图api创建谷歌地图活动。我生成了API密钥并将其粘贴到google_maps_API.xml`。我的清单文件是: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.l5434.project"> &l

我试图在android studio中使用谷歌地图api创建谷歌地图活动。我生成了API密钥并将其粘贴到google_maps_API.xml`。我的清单文件是:

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

    <!--
         The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but you must specify either coarse or fine
         location permissions for the 'MyLocation' functionality.
    -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <permission android:name="com.example.l5434.project" android:protectionLevel="signature"/>


    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!--
             The API key for Google Maps-based APIs is defined as a string resource.
             (See the file "res/values/google_maps_api.xml").
             Note that the API key is linked to the encryption key used to sign the APK.
             You need a different API key for each encryption key, including the release key that is used to
             sign the APK for publishing.
             You can define the keys for the debug and release targets in src/debug/ and src/release/.
        -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

        <activity
            android:name="pubsub.subscriber.MapsActivity"
            android:label="@string/title_activity_maps"></activity>
        <activity android:name="pubsub.subscriber.SubscriberActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>


你知道怎么了吗

此问题通常与用于签署清单的map API密钥有关。看看这篇文章,它描述了你正在经历的同样的错误。在这两种情况下,都是因为他们使用的API密钥是使用错误的密钥库创建的。在Google API控制台中创建API密钥时,您需要确保使用调试
keystore

build.gradle中是否也包含此项:“implementation'com.Google.maps.android:android maps utils:0.5+”。你看到了什么样的不当行为?下面是你在地图上看到谷歌标志了吗?我在地图活动开始时添加了模拟器的打印屏幕。