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文件夹中真实存在的依赖版本。
本人电脑中的路径:E:\Android\Sdk\extras\android\m2repository\com\android\support\recyclerview-v7
修改build.gradle文件,添加真实存在的依赖版本,注意sdk版本与依赖版本一致。
重新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'
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· 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