2016-07-19 6 views
1

ここに、私のXMLファイルのエントリーがあります。このエラーをもたらす最後の部分は、インパクト部分です。"予期しない名前空間プレフィックスがタグフラグメントに見つかりました"コードには影響していないようですが、誰かが何をしているのか分かりました。私はそれがリントの問題またはEclipseの問題だと言う投稿を見ましたが、私はAndroid Studioの最新バージョンを使用しています。予期せぬ名前空間 "map" - Android用のGoogle Maps API

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       xmlns:map="http://schemas.android.com/apk/res-auto" 
       android:background="#FFFFFF" 
       android:orientation="vertical"> 

    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:orientation="horizontal"> 

     <Button 
      android:id="@+id/button_lakeside_webview" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Lakeside"/> 

     <Button 
      android:id="@+id/button_spinner_webview" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Spinner"/> 

    </LinearLayout> 

    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"> 

     <View 
      android:id="@+id/colored_bar" 
      android:layout_width="48dp" 
      android:layout_height="3dp" 
      android:background="" /> 

    </LinearLayout> 

    <!-- Unsure why it complains about the map namespace, the below code is recommended by Google --> 

    <fragment xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:map="http://schemas.android.com/apk/res-auto" 
       android:name="com.google.android.gms.maps.SupportMapFragment" 
       android:id="@+id/map" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       map:cameraBearing="0" 
       map:cameraTilt="30" 
       map:cameraZoom="16" 
       map:mapType="normal" 
       map:uiCompass="false" 
       map:uiRotateGestures="false" 
       map:uiScrollGestures="false" 
       map:uiTiltGestures="false" 
       map:uiZoomControls="false" 
       map:uiZoomGestures="false"/> 

</LinearLayout> 
+0

と思いますかjavaを介してこれらの属性を設定する場合は? – Eenvincible

+0

XMLファイルにXMLエラーが表示されないので、私はそれを見ないと思います。 – Angel

答えて

1

あなたが言うように、Android Lintには既知のバグがあります。提出された問題のカップルがあります:

2016年7月14日に更新され、最後の1は、Android Studioの新しいバージョンの上、もう一度やり直してください」と述べています(2.2以上)。問題がまだ発生した場合は、新しいバグを報告してください。あなたは(私はそれをテストしているし、期待通りmap:性質が働く)エラーを無視するフラグメントに、このプロパティを追加することができます回避策として

:あなたはまだ、このような警告やエラーが表示されます

tools:ignore="MissingPrefix" 
+0

thurough答えと修正をありがとう。 – Angel