Android studio - 无法解决 : com. android.support :design:26. 0.1 错误

标签 android android-gradle-plugin

我有一个错误叫做:

 "Failed to resolve: com.android.support:design:26.0.1".

我的android studio版本是3.0 beta 1。

我的gradle文件如下:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
    applicationId "hojune.example"
    minSdkVersion 17
    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(include: ['*.jar'], dir: 'libs')
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.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.0.1'
}

我想把“设计”放到我的项目中,但是我做不到。我该怎么做?

最佳答案

将此添加到您的项目级别 build.gradle 文件:

repositories {
    maven {
        url "https://maven.google.com"
    }
}

澄清一下,这应该在 gradle 文件的“allprojects”部分(感谢@tys)

关于Android studio - 无法解决 : com. android.support :design:26. 0.1 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45615075/

相关文章:

android - 如何在 Android XML 中自动镜像形状

android - 程序类型已经存在 : org. hamcrest.CoreMatchers

android-studio - 如何从Android工作室Arctic Fox获取SHA1签名

android - gradle Android 上的两个类路径

android - 用测试类编译 jar

android - 我如何知道在模拟器上运行的是不是我的应用程序的最新版本?

android - Android 中 Gridview 中的 fragment

android - 在 fragment 中集成 google plus api 时出现 ClassCastException

android - 为android开发设置pc的问题

android - 更新 Android Studio 3.0 稳定更新后 Gradle Stuck 并花费很长时间