2017-07-16 121 views
0

我不能安裝約束佈局和其他庫一樣CardView和RecyclerView的新版本更新約束佈局

我的build.gradle文件:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.2" 
defaultConfig { 
    applicationId "com.example.radin.myapplication" 
    minSdkVersion 15 
    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:appcompat-v7:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:cardview-v7' 
    compile 'com.android.support:recyclerview-v7' 
} 

我沒有看到約束佈局的新版本在我的SDK經理 Screen shot of my sdk Manager

當我點擊安裝庫和同步項目沒有任何反應Screen shot of my android studio

回答

0

嘗試點擊安裝庫和同步工程和變化:

compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.android.support:cardview-v7' 
compile 'com.android.support:recyclerview-v7' 

到:

compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.android.support:recyclerview-v7:25.3.1' 
compile 'com.android.support:cardview-v7:25.3.1' 

而且從構建gradle這個文件中刪除此:

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
+0

它不工作。 .. –

+0

看到我更新的答案可能是與libs衝突的最後一件事 –