gpt4 book ai didi

android - 错误解析 :unbound prefix exception

转载 作者:太空狗 更新时间:2023-10-29 16:39:04 26 4
gpt4 key购买 nike

此代码显示未绑定(bind)异常,我尝试了所有组合..无法解决!!

    <com.google.android.maps:MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android.apikey="AIzaSyDIqLvjKi_VM7nT1DUSTzIeKDTuzPGFqrQ"/>

整个代码是:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps:MapView
android:id="@+id/map1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apikey="AIzaSyDIqLvjKi_VM7nT1DUSTzIeKDTuzPGFqrQ"/>
</RelativeLayout>

最佳答案

你需要这个

 xmlns:android="http://schemas.android.com/apk/res/android"

在您的 xml 根元素中

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView // :MapView is .MapView
android:id="@+id/map1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</RelativeLayout>

还有

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="api key"/>
// android.apikey

必须在manifest文件的application标签中

你可以找到一个例子

Android - android.view.InflateException: Binary XML file line #8: Error inflating class fragment

引用

https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2

关于android - 错误解析 :unbound prefix exception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21155202/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com