无法解析com.android.support:recyclerView-v7:26.1.0 [英] Could not resolve com.android.support:recyclerView-v7:26.1.0
问题描述
在我的应用程序中,我正在使用RecyclerView,因为我在标题中输入了错误,因此无法运行我的项目,之后我在Gradle中添加了依赖项文件.
In my app I am using RecyclerView for that I have added the dependency file in the Gradle after that I can't run my project because of the error I have put in the title.
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.nemuees.www.reminder"
minSdkVersion 21
targetSdkVersion 26
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerView-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:gridlayout-v7:26.1.0'
}
我已经提到了一些有关此错误的帖子,并将其放入我的build.gradle
And I have referred some SO post regarding this error and put this in my build.gradle
allprojects {
repositories {
google()
jcenter()
maven{
url "https://maven.google.com"
}
}
}
我已经取消选中了Gradle设置中的离线工作
And I have Unchecked the offline Work in Gradle Settings
有人可以帮我解决这个问题吗?
Can anyone help me to solve this.
推荐答案
可能是因为您忘记添加buildToolsVersion
.
May be because you forgot to add buildToolsVersion
.
喜欢
compileSdkVersion 27
buildToolsVersion "27.0.1"
同样,外观dependency
似乎添加了两次,因此删除仅定义一次.
Also it seems looking design dependency
added twice so remove that define it once only.
implementation 'com.android.support:design:26.1.0'
这篇关于无法解析com.android.support:recyclerView-v7:26.1.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!