无法解决:com.android.support.design:25.4.0

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

问题描述

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

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

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

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

But when executing Gradle I'm getting

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

我从 android 支持设计库中获得了支持代码 并将其添加到新项目中.我将它添加到依赖部分,如下所示:

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?

推荐答案

重要提示:现在可以通过 Google 的 Maven 存储库获得支持库.您无需下载支持SDK 管理器中的存储库.有关详细信息,请参阅 支持库设置.

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.

第 1 步:为您的应用打开 build.gradle 文件.

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

第 2 步:确保存储库部分包含带有https:/的 maven 部分/maven.google.com"端点.例如:

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"
        }
    }
}

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

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
cocos2d-android: how to display score(cocos2d-android:如何显示分数)
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
Android file copy(安卓文件拷贝)
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)