我对 Gradle 文件进行了一些更改,当我尝试运行该应用程序时出现此错误:java.lang.ClassNotFoundException:没有找到类“androidx.support.constraint.ConstraintLayout”----------XML------------<?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:configChanges = "orientation|keyboardHidden" tools:context=".MainActivity"> <ImageView android:id="@+id/imageView" android:layout_width="607dp" android:layout_height="313dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@mipmap/ic_launcher" /></android.support.constraint.ConstraintLayout>----------摇篮应用--------apply plugin: 'com.android.application'android { compileSdkVersion 28 defaultConfig { applicationId "com.example.eladk.flagged" minSdkVersion 27 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } }
1 回答
千巷猫影
TA贡献1829条经验 获得超7个赞
您应该将您的项目迁移到 AndroidX,例如ConstraintLayout
implementation "androidx.constraintlayout:constraintlayout:$constraintLayout_version"
添加回答
举报
0/150
提交
取消