简体   繁体   English

无法解决:Android Studio中的com.android.support:design:27

[英]Failed to resolve: com.android.support:design:27 in android studio

I have a this two error in android studio. 我在android studio中遇到了这两个错误。 How to fix this error. 如何解决此错误。

Error:(27, 13) Failed to resolve: com.android.support:design:27.+
    <a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:D:/android project/My` `Projects/MyApplication2/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

and

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:27.+
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:D:/android project/My Projects/MyApplication2/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

This is my dependencies code 这是我的依赖代码

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

How to fix this error 如何解决这个错误

To use support libraries starting from version 26.0.0 you need to add Google's Maven repository to your project's build.gradle file. 要使用从版本26.0.0开始的支持库,您需要将Google的Maven存储库添加到项目的build.gradle文件中。

  1. Open the build.gradle file for your application. 打开您的应用程序的build.gradle文件。
  2. Make sure that the repositories section includes a maven section with the " https://maven.google.com " endpoint. 确保存储库部分包括带有“ https://maven.google.com ”端点的maven部分。 For example: 例如:

Example: 例:

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

For Android Studio 3.0.0 and above: 对于Android Studio 3.0.0及更高版本:

allprojects {

    repositories {
        jcenter()
        google()
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解决:Android Studio中的com.android.support:design:26.2.0错误 - Failed to resolve: com.android.support:design:26.2.0 error in Android Studio 无法解决:com.android.support:design-v7:25.3.1 - Failed to resolve: com.android.support: design-v7:25.3.1 无法解析:com.android.support:support-v4:30.0.0 - Failed to resolve: com.android.support:support-v4:30.0.0 无法解析:com.android.support:support-v4:26.0.2 - Failed to resolve: com.android.support:support-v4:26.0.2 Android Studio <Failed to resolve: com.android.support:appcompat-v7:28.0.0> - Android Studio <Failed to resolve: com.android.support:appcompat-v7:28.0.0> Android Studio无法解决:com.android.support:appcompat-v7.28.0.0 - Android Studio Failed to resolve: com.android.support:appcompat-v7.28.0.0 错误:(30,18)无法解决:com.android.support:design-v7:25.3.1 - Error:(30, 18) Failed to resolve: com.android.support:design-v7:25.3.1 无法解决:com.android.support:cardview-v7:24.2.0 - Failed to resolve: com.android.support:cardview-v7:24.2.0 Android Studio Gradle无法找到&#39;com.android.support:design:22.2.0&#39;(Android设计支持库) - Android Studio Gradle cannot find 'com.android.support:design:22.2.0' (the Android Design Support Library) Gradle和Android:无法解析依赖项com.android.support - Gradle and Android: Could not resolve dependencies com.android.support
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM