Android 未能完成会话:安装\u失败\u无效\u APK:拆分库\u切片\u 0\u已多次定义APK
我正在尝试使用Android 未能完成会话:安装\u失败\u无效\u APK:拆分库\u切片\u 0\u已多次定义APK,android,android-layout,android-studio,android-constraintlayout,Android,Android Layout,Android Studio,Android Constraintlayout,我正在尝试使用约束布局。Gradle生成已成功完成。但我得到的“安装APK时出错”代码如下: 未能完成会话:安装\u失败\u无效\u APK:拆分库\u切片\u 0\u已多次定义APK 这是我的布局代码: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res
约束布局
。Gradle
生成已成功完成。但我得到的“安装APK时出错”代码如下:
未能完成会话:安装\u失败\u无效\u APK:拆分库\u切片\u 0\u已多次定义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ới\n 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ận\n 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ận\n lâm sàng"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
我首先在sub中得到一个关于“视图约束”的错误代码
我通过使用推断约束修复了它。
我不熟悉Android布局,我正在尝试使用
约束布局
制作一个响应性布局。请帮我解决这个问题。您可以通过重建项目来尝试
构建->清洁项目
Build->Rebuild Project请删除Build和.gradle文件夹,然后重建Project。Build\Clean Project+生成已签名的APK。。。为了我。
<LinearLayout></LinearLayout>