2017-08-20 45 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