当我使用recycleview时发现此错误
错误:(34,12)无法解决:com.android.support:recycleview-v7:26.0.0
安装存储库和同步项目
在文件中显示
在项目结构对话框中显示
compile'com.android.support:recycleview-v7:26.0.0'和compile'com.android.support:recycleview-v7:26.0.0-alpha1'我试试,但他们都不能成功。谁可以帮助我
这是gralde文件: apply plugin:'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.exploapplication"
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 {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
testCompile 'junit:junit:4.12'
compile'com.squareup.okhttp3:okhttp:3.4.1'
compile'com.google.code.gson:gson:2.7'
compile'com.android.support:design:26.0.0-alpha1'
compile'de.hdodenhof:circleimageview:2.1.0'
compile'com.android.support:cardview-v7:26.0.0-alpha1'
compile'com.android.support:recycleview-v7:26.0.0'
}
其他gradle: //顶级构建文件,您可以在其中添加所有子项目/模块共有的配置选项。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven{
url"https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
答案 0 :(得分:0)
在maven
区块中:
在url
&之间留出空格"https://maven.google.com"
它应该如下所示:url "https://maven.google.com"
接下来,
Show Package Details
Android SDK Build-Tools
的最新版本,Android SDK Platform-Tools
& Android SDK Tools
(查看随附的屏幕截图)Android Support Repository
& Google Repository
如果您没有compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:appcompat-v7:26.1.0'
compile'com.android.support:design:26.0.0-alpha1'
compile'com.android.support:design:26.1.0'