Не удалось завершить сеанс: ошибка установки недопустимый APK: Split lib slice 0 apk был определен несколько раз
Я пытаюсь использовать Constraint Layout
. Сборка Gradle
успешно завершена. Но я получил "ошибка установки APK" со следующим кодом:
Не удалось завершить сеанс: INSTALL_FAILED_INVALID_APK: Split lib_slice_0_apk был определен несколько раз
Вот мой код макета:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/app_bar_main">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Bạn cảm thấy thế nào" />
<Button
android:id="@+id/checkSicknessBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Kiểm tra"
android:textColor="@android:color/holo_blue_light"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#9ed7ec"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="@dimen/content_margin"
android:src="@drawable/baseline_access_alarm_white_48" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="Giờ uống thuốc sắp tới 15:30"
android:textAlignment="center"
android:textColor="#f29d15"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_keyboard_arrow_right_white_48" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:background="#9ed7ec"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="@dimen/content_margin"
android:src="@drawable/baseline_event_white_48" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="Lịch hẹn sắp tớin 29/2/2018 8:00"
android:textAlignment="center"
android:textColor="#f29d15"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_keyboard_arrow_right_white_48" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
app:layout_constraintBottom_toTopOf="@+id/linearLayout9"
app:layout_constraintTop_toTopOf="@+id/linearLayout9">
<LinearLayout
android:id="@+id/linearLayout11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="53dp"
android:layout_marginStart="53dp"
android:layout_weight="1"
android:background="#9ed7ec"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/baseline_history_white_48" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Lịch sửn khám bệnh"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginEnd="56dp"
android:layout_marginRight="56dp"
android:layout_weight="1"
android:background="#9ed7ec"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/baseline_insert_chart_outlined_white_48" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Kết quả cậnn lâm sàng"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin">
<LinearLayout
android:id="@+id/linearLayout13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="53dp"
android:layout_marginStart="53dp"
android:layout_weight="1"
android:background="#9ed7ec"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/baseline_history_white_48" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Lịch sửn khám bệnh"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginEnd="56dp"
android:layout_marginRight="56dp"
android:layout_weight="1"
android:background="#9ed7ec"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/baseline_insert_chart_outlined_white_48" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Kết quả cậnn lâm sàng"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
Я впервые получил код ошибки о "ограничении вида" в sub
<LinearLayout></LinearLayout>
И я исправил это, используя ограничение infer.
Я новичок в Android-макете и пытаюсь сделать отзывчивый макет с Constraint Layout
. Пожалуйста, помогите мне разобраться в этом.