2014-09-23 5 views
5

मैं अपने एंड्रॉइड एप्लिकेशन में मैपबॉक्स का उपयोग करने की कोशिश कर रहा हूं। मैं एंड्रॉइड स्टूडियो 0.8.0 का उपयोग करता हूं। मैं अपने build.gradle में इस लाइन फाइलXML को पार्स करने में त्रुटि: मैपबॉक्स के लिए अनबाउंड उपसर्ग

compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]'){ 
     transitive=true 
    } 
    compile ('com.cocoahero.android:geojson:[email protected]'){ 
     transitive=true 
    } 

शामिल किया है लेकिन जब मैं अपने xml फ़ाइल में यह उपयोग कर रहा हूँ, यह एक नाम स्थान त्रुटि है। मैपबॉक्स नेमस्पेस का कारण बनता है। कोई विचार क्या कारण हो सकता है?

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

डालने की कोशिश करो केवल mapId = "अपने मानचित्र आईडी कुंजी " – Psypher

उत्तर

4

ठीक है आखिरकार हल हो गया है।

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

एक्सएमएल उदाहरण:

<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> 
+0

चीयर्स। इससे – jonney

+0

बहुत मदद मिली, जिसने मेरी समस्या हल की –

+0

@ stephen1706 मुझे भी एक ही समस्या त्रुटि मिल रही है: पैकेज 'com.example.mapbox' में विशेषता 'मैपिड' के लिए कोई संसाधन पहचानकर्ता नहीं मिला – Erum

6

तुम भी अपने xml में इस लाइन को जोड़ने के द्वारा इस त्रुटि को ठीक कर सकते हैं: मैं अपने xml फ़ाइल को बदलने

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:mapbox="http://schemas.android.com/apk/res-auto" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    > 


    <com.mapbox.mapboxsdk.views.MapView 
     android:id="@+id/mapview" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     mapbox:mapid="your id" /> 

</LinearLayout> 
संबंधित मुद्दे