错误分析:绑定preFIX例外 [英] error parsing:unbound prefix exception

查看:236
本文介绍了错误分析:绑定preFIX例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这code显示未绑定的例外,我尝试了所有组合..着ressolve !!

 < com.google.android.maps:图形页面
     机器人:layout_width =FILL_PARENT
     机器人:layout_height =FILL_PARENT
     android.apikey =AIzaSyDIqLvjKi_VM7nT1DUSTzIeKDTuzPGFqrQ/>

整个code是:

 <?XML版本=1.0编码=UTF-8&GT?;
     <的RelativeLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
      机器人:layout_width =FILL_PARENT
      机器人:layout_height =FILL_PARENT>
     < com.google.android.maps:图形页面
      机器人:ID =@ + ID / MAP1
      机器人:layout_width =FILL_PARENT
      机器人:layout_height =FILL_PARENT
      机器人:apikey =AIzaSyDIqLvjKi_VM7nT1DUSTzIeKDTuzPGFqrQ/>
     < / RelativeLayout的>


解决方案

您需要这个

 的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android

在XML的根元素

 <?XML版本=1.0编码=UTF-8&GT?;
     <的RelativeLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
      机器人:layout_width =FILL_PARENT
      机器人:layout_height =FILL_PARENT>
     < com.google.android.maps.MapView //:MapView的是.MapView
      机器人:ID =@ + ID / MAP1
      机器人:layout_width =FILL_PARENT
      机器人:layout_height =FILL_PARENT/>
     < / RelativeLayout的>

此外

 <元数据
机器人:名字=com.google.android.maps.v2.API_KEY
机器人:值=API密钥/>
// android.apikey

必须在清单文件的应用程序标记

您可以找到一个例子

<一个href=\"http://stackoverflow.com/questions/20919048/android-android-view-inflateexception-binary-xml-file-line-8-error-inflatin/20971284#20971284\">Android - android.view.InflateException:二进制XML文件行#8:错误充气类片段

参考

<一个href=\"https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2\" rel=\"nofollow\">https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2

This code shows unbound exception,i tried all combinations.. cant ressolve !!

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

The entire code is:

    <?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>

解决方案

You need this

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

in your root element of 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>

Also

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

must be in application tag of manifest file

You can find an example

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

Reference

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

这篇关于错误分析:绑定preFIX例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆