错误的解析XML:未绑定preFIX的mapbox [英] Error parsing XML: unbound prefix for mapbox
本文介绍了错误的解析XML:未绑定preFIX的mapbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图用mapbox在我的Android应用程序。我采用Android 0.8.0工作室。我已经包括此行中我build.gradle文件
编译('com.mapbox.mapboxsdk:mapbox,Android的SDK:0.4.0@aar'){
传递=真
}
编译(com.cocoahero.android:geojson:1.0.0@aar'){
传递=真
}
但是,当我使用它在我的XML文件,它有一个命名空间的错误。在mapbox命名空间会导致。任何想法可能会导致?
< XML版本=1.0编码=UTF-8&GT?;
<滚动型的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT
机器人:ID =@ + ID / parent_layout>
<的LinearLayout
机器人:方向=垂直机器人:layout_width =match_parent
机器人:layout_height =match_parent>
<的TextView
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:TEXTSIZE =15sp
机器人:文本=这是一般标签/>
< com.mapbox.mapboxsdk.views.MapView - >不会导致错误
机器人:ID =@ + ID /图形页面
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
mapbox:的azazaz =你的MapBox的azazaz/> - >造成错误
< / LinearLayout中>
< /滚动型>
解决方案
还好总算是解决了。我改变我的xml文件:
<滚动型的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT
的xmlns:程序=http://schemas.android.com/apk/res-auto
机器人:ID =@ + ID / parent_layout>
< com.mapbox.mapboxsdk.views.MapView
机器人:ID =@ + ID /的azazaz
机器人:可聚焦=假
机器人:focusableInTouchMode =假
机器人:paddingTop =10dp
应用:的azazaz =你的地图ID
机器人:layout_width =match_parent
机器人:layout_height =320dp>
< /com.mapbox.mapboxsdk.views.MapView>
< /滚动型>
I'm trying to use mapbox in my android application. I use android studio 0.8.0. I've included this line in my build.gradle file
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:0.4.0@aar'){
transitive=true
}
compile ('com.cocoahero.android:geojson:1.0.0@aar'){
transitive=true
}
But when I'm using it in my xml file, it has a namespace error. the mapbox namespace causes that. any idea what might cause that?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/parent_layout">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="15sp"
android:text="this is the general tab"/>
<com.mapbox.mapboxsdk.views.MapView -->not causing error
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
mapbox:mapid="Your MapBox mapid" /> -->causing error
</LinearLayout>
</ScrollView>
解决方案
okay finally it is solved. I change my xml file :
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/parent_layout">
<com.mapbox.mapboxsdk.views.MapView
android:id="@+id/mapid"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingTop="10dp"
app:mapid="your map id"
android:layout_width="match_parent"
android:layout_height="320dp" >
</com.mapbox.mapboxsdk.views.MapView>
</ScrollView>
这篇关于错误的解析XML:未绑定preFIX的mapbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文