C# 尝试将google map添加到Xamarin时未找到错误API密钥

C# 尝试将google map添加到Xamarin时未找到错误API密钥,c#,google-maps,xamarin,C#,Google Maps,Xamarin,我试图在Xamarin表单应用程序中添加谷歌地图,但当我运行它时 发生以下错误: Java.Lang.RuntimeException 消息=未找到API密钥。检查AndroidManifest.xml元素中的 Java.Lang.RuntimeException:'未找到API密钥。检查AndroidManifest.xml的元素中的 有没有办法知道这个API是活动的 检查此文档页面: 在“以下代码段是必须添加到AndroidManifest.XML的设置示例:”之后向下滚动一点到大代码

我试图在Xamarin表单应用程序中添加谷歌地图,但当我运行它时 发生以下错误:

Java.Lang.RuntimeException
消息=未找到API密钥。检查AndroidManifest.xml元素中的

Java.Lang.RuntimeException:'未找到API密钥。检查AndroidManifest.xml的元素中的

有没有办法知道这个API是活动的

检查此文档页面:

在“以下代码段是必须添加到AndroidManifest.XML的设置示例:”之后向下滚动一点到大代码块,并确保用实际的API密钥替换您的API密钥

从链接复制(如果它消失):

以下代码段是必须添加到AndroidManifest.XML的设置示例:
检查此文档页面:

在“以下代码段是必须添加到AndroidManifest.XML的设置示例:”之后向下滚动一点到大代码块,并确保用实际的API密钥替换您的API密钥

从链接复制(如果它消失):

以下代码段是必须添加到AndroidManifest.XML的设置示例:

您的API密钥可以在谷歌云平台控制台中找到

以下是链接:


您可以通过在GCP控制台的API库中搜索“Android地图SDK”来检查其状态:

您的API密钥可以在谷歌云平台控制台中找到

以下是链接:


您可以通过在GCP控制台的API库中搜索“Maps SDK for Android”来检查它的状态:

确保它在应用程序元素中并且拼写正确


确保它位于应用程序元素内,并且拼写正确


实际向我们显示您的清单将是helpfuleror message@ghaith不查找错误(您已经列出了该错误),我们正在查找您的android清单以及您如何向其添加密钥。请不要发布代码或错误,因为图像实际向我们显示您的清单将是helpfuleror message@ghaith不查找错误(您已经列出了),我们正在查找您的android清单以及您是如何向其中添加密钥的。请不要将代码或错误作为图像发布
The following snippet is an example of the settings that must be added to AndroidManifest.XML:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
          android:versionName="4.5" 
          package="com.xamarin.docs.android.mapsandlocationdemo2" 
          android:versionCode="6">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />

    <!-- Google Maps for Android v2 requires OpenGL ES v2 -->
    <uses-feature android:glEsVersion="0x00020000" android:required="true" />

    <!-- Necessary for apps that target Android 9.0 or higher -->
    <uses-library android:name="org.apache.http.legacy" android:required="false" />


    <!-- Permission to receive remote notifications from Google Play Services -->
    <!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
    <uses-permission android:name="<PACKAGE NAME>.permission.MAPS_RECEIVE" />
    <permission android:name="<PACKAGE NAME>.permission.MAPS_RECEIVE" android:protectionLevel="signature" />

    <!-- These are optional, but recommended. They will allow Maps to use the My Location provider. -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />


    <application android:label="@string/app_name">
        <!-- Put your Google Maps V2 API Key here. -->
        <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR_API_KEY" />
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
        <!-- Necessary for apps that target Android 9.0 or higher -->
        <uses-library android:name="org.apache.http.legacy" android:required="false" />
    </application>
</manifest>