【问题标题】:gradle build fail Error: Failed to resolve: com.android.support:cardview-v7:24.0.1 and ) Failed to resolve: com.android.support:appcompat-v7:24.0.1gradle build fail 错误:无法解决:com.android.support:cardview-v7:24.0.1 和)无法解决:com.android.support:appcompat-v7:24.0.1
【发布时间】:2017-01-07 21:46:47
【问题描述】:

无法解决:com.android.support:cardview-v7:24.0.1 和 ) 无法解决:com.android.support:appcompat-v7:24.0.1

这是 gradle 配置 我需要做什么来解决这个问题 请帮帮我

apply plugin: 'com.android.application'

    compileSdkVersion 24
    buildToolsVersion '24.0.1'
    defaultConfig {
        applicationId 'com.fanbaseafrica.fabaservices'
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 2
        versionName '2.0'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable false

            signingConfig signingConfigs.config

            renderscriptOptimLevel 3
        }
        debug {
            debuggable true
        }
    }
    productFlavors {
    }
}
repositories {
    jcenter()

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:cardview-v7:24.0.1'
    compile 'com.android.support:appcompat-v7:24.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:design:24.0.1'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.google.code.gson:gson:2.2.3'
    compile 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.android.support:recyclerview-v4:24.0.1'
    compile 'com.android.support:support-v7:24.0.1'
    compile 'com.koushikdutta.ion:ion:2.1.6'
    compile 'com.sprylab.android.texturevideoview:texturevideoview:1.1.1'
}

【问题讨论】:

  • 如果没有,请下载库,它一定会给你下载链接
  • 它确实给了我下载链接,但它不起作用
  • 我的电脑已经联网了

标签: android android-gradle-plugin android-support-library


【解决方案1】:

这是因为 24.0.1 的支持库不存在。

使用有效版本更改所有支持库的依赖项:

24.0.0
24.1.0
24.1.1
24.2.0

这里所有的history

还有一些依赖是错误的:

变化:

compile 'com.android.support:recyclerview-v4:24.0.1'

compile 'com.android.support:recyclerview-v7:24.X.X'

'com.android.support:support-v7:24.X.X' 不存在。

使用

compile 'com.android.support:support-v4:24.x.x'.

【讨论】:

  • 解析失败:com.android.support:recyclerview-v4:24.0.0
  • 因为是错误的依赖:使用com.android.support:recyclerview-v7:24.0.0。刚刚更新了答案。
  • 我使用 plus 符号表示法 来表示任何错误输出 compile 'com.android.support:design:24.+' 的编译行。谢谢!
猜你喜欢
  • 2017-01-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-03
  • 1970-01-01
  • 2017-12-19
  • 2018-01-03
相关资源
最近更新 更多