2015-05-25 2 views
-3
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:orientation="horizontal" 

    <EditText 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:hint="@string/hint_message" 
     /> 


</LinearLayout> 

Это мой код. В Android Studio 1.2.1.1, он возвращает ошибки:Android Studio: Разбор XML не является корректной ошибкой.

  • Ошибка: (8) Ошибка разбора XML: не хорошо сформирован (недействительный маркер)
  • Ошибка: Не удалось завершить выполнение задачи для ': Приложение: processDebugResources' , com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command' C: \ Users \ hayden \ AppData \ Local \ Android \ sdk \ build-tools \ 22.0.1 \ aapt.exe '' закончил с ненулевым значением выхода 1

Я использую Windows 8.My Code Encoding устанавливается для windows-1252. Пожалуйста, помогите.

+0

Вы пропустили '>' для 'LinearLayout'. – Piyush

+0

Добавьте закрывающий кронштейн **> ** после ** android: orientation = "horizontal" ** в LinearLayout. –

+0

Это пустая трата времени других. – SilentKnight

ответ

0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:orientation="horizontal"> <!-- Here is the error you forgot to close LinearLayout--> 

<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:hint="@string/hint_message" 
    /> 


</LinearLayout> 

Вы забыли написать > после определения свойств в LinearLayout и эту ошибку, вы могли бы поймали, если вы правильно заметили цвет в IDE. или вы внимательно прочитали ошибку.

0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:orientation="horizontal" > 

    <EditText 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:hint="@string/hint_message" 
     /> 
</LinearLayout> 
Смежные вопросы