我已經在 Android 作業室做了幾天了,但我從來沒有遇到過這樣的問題 :(
僅顯示背景空白文本androidx.constraintlayout....ConstraintLayout
XML 檔案
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@ id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?attr/actionBarSize">
</androidx.constraintlayout.widget.ConstraintLayout>
搖籃檔案
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.navigation:navigation-fragment:2.4.0'
implementation 'androidx.navigation:navigation-ui:2.4.0'
testImplementation 'junit:junit:4. '
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
在此處輸入影像描述
uj5u.com熱心網友回復:
我認為它與 Gradle 腳本檔案版本問題有關,只需查看您的依賴項并在它已過時進行更改..也許這會有所幫助?
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
testImplementation 'junit:junit:4. '
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
并同步它!
uj5u.com熱心網友回復:
Constraintlayout在您的應用級別更新您的依賴項build.gradle并檢查:
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/426326.html
