【发布时间】:2014-09-23 03:07:29
【问题描述】:
我正在尝试在我的 android 应用程序中使用 mapbox。我使用安卓工作室 0.8.0。我已将这一行包含在我的 build.gradle 文件中
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:0.4.0@aar'){
transitive=true
}
compile ('com.cocoahero.android:geojson:1.0.0@aar'){
transitive=true
}
但是当我在我的 xml 文件中使用它时,它有一个命名空间错误。 mapbox 命名空间导致了这一点。知道是什么原因造成的吗?
<?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>
【问题讨论】:
-
试着只放 mapid="your map id key"
标签: android xml android-studio mapbox