Android studio 3.0 Unable to resolve dependency for

兴建的工程 就出现这个错误

出现的异常

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.1.
Open File
Show Details

Google 了一把 各种回答

解决方案

看错误的信息

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.1.

我的理解 不能加载1.1.1 版本的 那么 就改成

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.allens.test"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
 //   implementation 'com.android.support.constraint:constraint-layout:1.1.1'
//替换陈这个版本的
   implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:support-v4:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

}

build

ok

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 相信很多人都收到了Android studio 3.0稳定版的升级提醒 回想一下,2.3的就可以编译通过,3.0的...
    諸星団阅读 2,953评论 0 0
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,076评论 25 708
  • 愿时光不曾老去,一切都还是当初的模样。蓦然秋雨的时节,悄悄离去,也抓不住它的尾巴。那水上的楼榭,无复当初的繁华,已...
    巴图鲁阅读 259评论 0 3
  • 2017.12.29(312~焦点原创分享172) 当大事儿小事儿,公事私事儿,一件件摆在面前的时候。的确给...
    方正省阅读 297评论 0 1
  • 时间越来越快,岁数越来越大,真的是应了小时候妈妈说的那句,等你长大了你就想小时候了。当时我在想怎么可能,大了想吃什...
    一个好瘦的胖子阅读 186评论 0 0