错误:(34,12)无法解决:com.android.support:recycleview-v7:26.0.0-alpha1

时间:2017-10-24 00:15:39

标签: android

当我使用recycleview时发现此错误 错误:(34,12)无法解决:com.android.support:recycleview-v7:26.0.0 安装存储库和同步项目
在文件中显示
在项目结构对话框中显示 compile'c​​om.android.support:recycleview-v7:26.0.0'和compile'c​​om.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
}

this is the content "D:\androidsdk\android-sdk-windows\extras\android\m2repository\com\android\support\recyclerview-v7"

1 个答案:

答案 0 :(得分:0)

maven区块中:

url&之间留出空格"https://maven.google.com"

它应该如下所示:url "https://maven.google.com"

接下来,

  1. 从Android Stuido转到Android SDK
  2. 点击右下角的Show Package Details
  3. 点击Android SDK Build-Tools的最新版本,Android SDK Platform-Tools& Android SDK Tools(查看随附的屏幕截图)
  4. 安装Android Support Repository& Google Repository如果您没有
  5. 替换compile 'com.android.support:appcompat-v7:26.+'
  6. compile 'com.android.support:appcompat-v7:26.1.0'

    1. 替换compile'com.android.support:design:26.0.0-alpha1'
    2. compile'com.android.support:design:26.1.0'

      1. 替换compile'com.android.support:cardview-v7:26.0.0-alpha1'
      2. compile'com.android.support:cardview-v7:26.1.0'

        1. 替换compile'com.android.support:recycleview-v7:26.0.0'
        2. compile'com.android.support:recycleview-v7:26.1.0'

          Android SDK