亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何修復Android Studio中的“無法解決符號”v7“錯誤

如何修復Android Studio中的“無法解決符號”v7“錯誤

翻過高山走不出你 2022-09-07 17:14:19
我正在嘗試使用android支持recyclerView小部件,盡管我已經將所有依賴項添加到我的build.gradle文件中(我認為),但我的活動中的行“import android.support.v7.widget.RecyclerView;”沒有解析。我是Android Studio的新手,所以我可能錯過了一些非常基本的東西。到目前為止,我已經嘗試在項目構建級別的所有項目中添加Google存儲庫,以及我的模塊構建級別。我還改變了我的依賴關系,并嘗試更改版本號。我嘗試使緩存無效并重新啟動。我似乎能夠導入“import androidx.recyclerview.widget.RecyclerView;”,但這與我聽到的不一樣。這是我的構建 gradle 文件://noinspection GradleCompatibleapply plugin: 'com.android.application'android {    compileSdkVersion 28    buildToolsVersion '28.0.3'    defaultConfig {        applicationId "com.example.chaos"        minSdkVersion 20        targetSdkVersion 28        versionCode 1        versionName "1.0"        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"    }    buildTypes {        customDebugType {            debuggable true        }        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'        }    }}dependencies {    implementation fileTree(dir: 'libs', include: ['*.jar'])    implementation 'com.android.support:appcompat-v7:28.0.0'    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'    implementation 'com.android.support:design:28.0.0'    //implementation 'com.android.support:recyclerview-v7:28.0.0'    implementation 'android.arch.persistence.room:runtime:1.1.1'    annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'    androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'   // implementation 'com.android.support:support-v7'    testImplementation 'junit:junit:4.12'    androidTestImplementation 'androidx.test:runner:1.1.2-alpha02'    androidTestImplementation ('androidx.test.espresso:espresso-core:3.2.0-alpha02', {        exclude group: 'com.android.support', module: 'support-annotations'    })}這就是我在主要活動中嘗試的導入。似乎我可以導入android.support.v4庫,但v7甚至不是一個自動完成選項。我很感激的幫助!import android.support.v7.app.AppCompatActivity;import android.support.v7.widget.RecyclerView;我希望導入行能夠解析,因為它目前還沒有。
查看完整描述

1 回答

?
ITMISS

TA貢獻1871條經驗 獲得超8個贊

如果您使用的是 Android X,請嘗試此依賴項

implementation 'androidx.recyclerview:recyclerview:1.0.0'


查看完整回答
反對 回復 2022-09-07
  • 1 回答
  • 0 關注
  • 186 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號