Unexpected namespace prefix “xmlns” found for tag LinearLayout

前端 未结 7 853
离开以前
离开以前 2020-11-30 05:36

I am having an error in following xml file. \"Unexpected namespace prefix \"xmlns\" found for tag LinearLayout\". I tried the solutions provided in other similar qu

7条回答
  •  一整个雨季
    2020-11-30 06:09

    In an Android xml file, the Android namespace can:

    • only be declared once
    • only be declared in the top ('outer') Android View in the xml hierarchy

    or you'll receive an error when building the project. In your case, the top Android view is the ScrollView, so keep

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

    in the ScrollView, and remove it from all other nested Views, including the LinearLayout.

提交回复
热议问题