[英]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文件中。
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.