2017-08-20 44 views
0

我的build.gradle的代码(moudule APP)编译 'com.android.support.constraint:约束的布局:1.0.0-alpha7' 无法解决

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    defaultConfig { 
     applicationId "com.example.hn.myapplication" 
     minSdkVersion 14 
     targetSdkVersion 25 
     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(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.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:appcompat-v7:25.+' 
    compile 'com.android.support:recyclerview-v7:25.+' 
    compile 'com.android.support:support-v4:25.+' 
    compile 'com.android.support:design:25.+' 
    //compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0' 
    testCompile 'junit:junit:4.12' 
} 

,这是我的SDK工具。 enter image description here

我尝试compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'compile 'com.android.support.constraint:constraint-layout:1.0.0'compile 'com.android.support.constraint:constraint-layout:1.+' 但不工作。并且错误是 Failed to resolve: com.android.support.constraint:constraint-layout:1 我是谁解决了这个问题?

当我使用compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7 此错误进行:安装神器和同步工程

+0

尝试我的编译'com.android.support.constraint:constraint-layout:1.0.2' – Salman500

+0

编译但是这个错误已经完成:'Install Repository and sync project' – hnh

回答

0

转到文件 - >设置 - > SDK管理器 - > SDK工具 - >然后再安装谷歌库

enter image description here