"fate of the processing instruction"错误google_maps_api.xml



我是这个论坛的新手,一般在android开发。我希望帮助解决我在运行应用程序时遇到的问题。我现在正在开发的应用程序是基于谷歌地图的活动。我已经完成了在google api开发人员中创建凭据的所有步骤,并将密钥复制到xml和manifest。当我运行应用程序时,我得到这个错误:

Error: (2,10) Error:匹配"[xX] [mM] [lL] &quot是不允许的。App: mergeDebugResources FAILED

我现在要做的就是运行应用程序并显示谷歌地图

这是google_maps_api.xml:

<resources><string name="google_maps_key" translatable="false" templateMergeStrategy="preserve">AIzaSyDtbq2HdPj5VpKCCvhj1vbuUaA1HIAz8Gg</string>
<?xml version="1.0" encoding="utf-8" ?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    android:name="com.google.android.gms.maps.MapFragment"
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/></resources>

我在我的一个android项目中也遇到了同样的问题。

在我的情况下,它来自AndroidManifest.xml。因为我加了

<?xml version="1.0" encoding="utf-8"?>

在文件的开头

这一行不应该出现在文件中。我通过去掉线。

在您的情况下,您也有AndroidManifest.xml文件中的行。所以把它去掉。我想这会解决你的问题。

最新更新