无法解析:com.android.support.design:25.4.0 [英] Failed to resolve: com.android.support.design:25.4.0

查看:101
本文介绍了无法解析:com.android.support.design:25.4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将以下行添加到了我的build.gradle(Module:app)中:

  compile'c​​om.android.support :design:25.4.0'

但是当执行Gradle时,我得到了

 未能解决:com.android.support.design:25.4.0 

我从android 支持设计库并将其添加到新项目中。我将它添加到dependency部分,如下所示:

 依赖关系{
编译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'c​​om.android.support:appcompat-v7:25.3.1'
compile'c​​om.android.support.constraint:constraint- layout:1.0.2'
testCompile'junit:junit:4.12'

compile'c​​om.android.support:design:25.4.0'
}

关于我在做什么的错误?

解决方案


重要提示:支持库现在可通过Google的Maven存储库使用。您无需从SDK Manager下载支持
存储库。有关更多信息,请参阅支持
Library Setup


第1步:打开应用程序的build.gradle文件。 b

第2步:确保存储库部分包含一个maven部分,其中包含 https://maven.google.com 端点。例如:

  allprojects {
存储库{
jcenter()
maven {
urlhttps://maven.google.com
}
}
}

第3步:将支持库添加到依赖项部分。例如,要添加v4 core-utils库,请添加以下行:

 依赖关系{
...
compilecom.android.support:support-core-utils:25.4.0
}


I added the following line to my build.gradle(Module:app):

compile 'com.android.support:design:25.4.0' 

But when executing Gradle I'm getting

Failed to resolve: com.android.support.design:25.4.0

I got that the support code from the android support design library and added it to a new project. I added it to the dependency section as such:

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:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:25.4.0'
}

Any ideas on what I'm doing wrong?

解决方案

Important: The support libraries are now available through Google's Maven repository. You do not need to download the support repository from the SDK Manager. For more information, see Support Library Setup.

Step 1: Open the build.gradle file for your application.

Step 2: Make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint. For example:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

Step 3: Add the support library to the dependencies section. For example, to add the v4 core-utils library, add the following lines:

dependencies {
    ...
    compile "com.android.support:support-core-utils:25.4.0"
}

这篇关于无法解析:com.android.support.design:25.4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆