我對 Gradle 文件進(jìn)行了一些更改,當(dāng)我嘗試運(yùn)行該應(yīng)用程序時出現(xiàn)此錯誤: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>----------搖籃應(yīng)用--------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貢獻(xiàn)1829條經(jīng)驗 獲得超7個贊
您應(yīng)該將您的項目遷移到 AndroidX,例如ConstraintLayout
implementation "androidx.constraintlayout:constraintlayout:$constraintLayout_version"
添加回答
舉報
0/150
提交
取消