011 Error:Failed to resolve: com.android.support:recyclerview-v7:28.0.0解决方法

011 Error:Failed to resolve: com.android.support:recyclerview-v7:28.0.0解决方法

参考链接:
https://blog.csdn.net/qq874455953/article/details/83025425

在使用Android Studio的过程中需要添加依赖recyclerview,出现报错:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:recyclerview-v7:27.1.1. 报错原因:添加依赖的方法错误。添加了不存在的依赖。解决办法:查看sdk文件夹中真实存在的依赖版本。

mark

本人电脑中的路径:E:\Android\Sdk\extras\android\m2repository\com\android\support\recyclerview-v7
mark

修改build.gradle文件,添加真实存在的依赖版本,注意sdk版本与依赖版本一致。
mark

重新build 构建gradle 即可。

本人最终配置,gradle构建成功的版本:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30

    defaultConfig {
        applicationId "com.example.recyclerviewtest"
        minSdkVersion 14
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:+'
    implementation 'com.android.support:recyclerview-v7:24.2.1'
    implementation 'com.android.support.constraint:constraint-layout:2.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

posted @   皿哥的技术人生  阅读(631)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示