Несоответствующий тег в коде и ошибка APPT2 - PullRequest
0 голосов
/ 28 августа 2018

У меня есть этот код, где я всегда получаю сообщение об ошибке несоответствующего тега, я сам не вижу ошибки, может кто-нибудь мне помочь? спасибо миллион.

И я также получаю эту ошибку: Ошибка: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: ошибка AAPT2: проверьте журналы для подробностей

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".DetailsSongs">

    <android.support.design.widget.AppBarLayout
        android:layout_widht="match_parent"
        android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="FFECB3"
            android:padding="16dp"
            android:text="@string/songdetailsdescription" />
    </android.support.design.widget.AppBarLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientaion="vertical"
        android:weightSum="1"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1">

            <Linearlayout
                android:layout_width="match_parent"
                android:layouth_height="wrap_content"
                android:layout_marginEnd="16dp"
                android:layout_marginStart="16dp"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layouth_height="match_content"
                    android:layout_marginBottom="16dp"
                    android:layout_marginTop="16dp"
                    android:orientation="horizontal">


                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:background="@drawable/image_placeholder_dark_large"
                        android:contentDescription="@string/songdetailscontentdescriptionalbumart"
                        android:scaleType="center" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="8dp"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="8dp"
                            android:layout_marginStart="8dp"
                            android:paddingTop="16dp"
                            android:text="@string/songnameplaceholder"
                            android:textSize="24sp"
                            android:textStyle="bold" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="8dp"
                            android:layout_marginStart="8dp"
                            android:paddingTop="4dp"
                            android:text="@string/songauthorplaceholder"
                            android:textSize="16sp"
                            android:textStyle="bold" />

                        <Button
                            style="?android:attr/buttonBarButtonStyle"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:drawableEnd="@drawable/media_controls_play_dark_small"
                            android:gravity="center"
                            android:paddingBottom="2dp"
                            android:paddingBtottom="2dp"
                            android:text="@string/songdetailsplaynow" />

Здесь говорится, что под этим комментарием есть ошибка (LinearLayout)

                    </Linearlayout>


                </LinearLayout>


                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/songdetailssimilarsongs"
                    android:textSize="18sp" />

                <HorizontalScrollView
                    android:id="@+id/related_albums"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="16dp" >
                    <include layout="@layout/relatedsongslist" />
                </HorizontalScrollView>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingBottom="16dp"
                    android:text="@string/songdescriptionplaceholder" />

            </LinearLayout>
        </ScrollView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_weight="1">

            <include layout="@layout/player" />
        </LinearLayout>
    </LinearLayout>
</android.support.design.widget.CoordinatorLayout>

1 Ответ

0 голосов
/ 28 августа 2018

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

но это то, что я могу помочь. переписал свой xml.

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DetailsSongs">

<android.support.design.widget.AppBarLayout
    android:layout_widht="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="FFECB3"
        android:padding="16dp"
        android:text="@string/songdetailsdescription" />
</android.support.design.widget.AppBarLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientaion="vertical"
    android:weightSum="1"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1">

    <Linearlayout
        android:layout_width="match_parent"
        android:layouth_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:layout_marginStart="16dp"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layouth_height="match_content"
            android:layout_marginBottom="16dp"
            android:layout_marginTop="16dp"
            android:orientation="horizontal">


        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:background="@drawable/image_placeholder_dark_large"
            android:contentDescription="@string/songdetailscontentdescriptionalbumart"
            android:scaleType="center" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:orientation="vertical">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="8dp"
                android:paddingTop="16dp"
                android:text="@string/songnameplaceholder"
                android:textSize="24sp"
                android:textStyle="bold" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="8dp"
                android:paddingTop="4dp"
                android:text="@string/songauthorplaceholder"
                android:textSize="16sp"
                android:textStyle="bold" />

            <Button
                style="?android:attr/buttonBarButtonStyle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableEnd="@drawable/media_controls_play_dark_small"
                android:gravity="center"
                android:paddingBottom="2dp"
                android:paddingBtottom="2dp"
                android:text="@string/songdetailsplaynow" />
        </LinearLayout>
    </Linearlayout>



        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/songdetailssimilarsongs"
            android:textSize="18sp" />

        <HorizontalScrollView
            android:id="@+id/related_albums"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp" >
            <include layout="@layout/relatedsongslist" />
        </HorizontalScrollView>

            <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingBottom="16dp"
            android:text="@string/songdescriptionplaceholder" />
    </ScrollView>
</LinearLayout>

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:layout_weight="1">

    <include layout="@layout/player" />
    </LinearLayout>
</android.support.design.widget.CoordinatorLayout>

Попробуйте это и, надеюсь, могли бы помочь вам

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...