обнаружил эту проблему на моем Android: AAPT: ошибка: неправильно сформирован (неверный токен) - PullRequest
0 голосов
/ 20 октября 2019

я пытался сделать нижнюю навигацию, но из учебника, но я получаю эту ошибку, массаж

D:\praktikum\app\src\main\res\layout\fragment_home.xml:8: AAPT: error: not well-formed (invalid token).

вот мой xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/logo"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_gravity="center"
        android:background="@mipmap/ic_launcher" />

    <TextView
        android:id="@+id/TextView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="5dp"
        android:layout_marginTop="5dp"
        android:text="www.dedykuncoro.com"
        android:textSize="18dip"
        android:textStyle="bold" />

    <View
        android:id="@+id/View1"
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:layout_gravity="center"
        android:background="#448AFF" />

    <TextView
        android:id="@+id/txt_id"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="10dp"
        android:text="ID"/>

    <TextView
        android:id="@+id/txt_username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="10dp"
        android:text="Username"/>

    <Button
        android:id="@+id/btn_logout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="50dp"
        android:background="#00555555"
        android:text="Logout"
        android:textStyle="bold" />

 </LinearLayout>

</RelativeLayout>

я читал похожий вопрос по stackoverflow, их проблема в /> но я проверил это в своем коде, все хорошо, но я не знаю, почему я получаю эту ошибку

большое спасибо за ваше время и ответ

1 Ответ

1 голос
/ 20 октября 2019

Вы не закрыли открывающий тег вашего RelativeLayout

Существующий

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp"

Должен быть

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp">
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...