依赖关系版本错误我不能改变版本
问题描述:
我想改变我的'com.android.support:recyclerview'的版本。一般来说,当你想改变Android的支持版本,你必须改变所有连接到com.android.support的依赖,所以我把最新版本是26.1.0,它不断给我这个错误 请帮助我出去依赖关系版本错误我不能改变版本
Error:(47, 13) Failed to resolve: com.android.support:support-v4:26.1.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/median1/AndroidStudioProjects/sora/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:(41, 13) Failed to resolve: com.android.support.constraint:constraint-layout:26.1.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/median1/AndroidStudioProjects/sora/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:(46, 13) Failed to resolve: com.android.support:design:26.1.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/median1/AndroidStudioProjects/sora/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:(46, 13) Failed to resolve: com.android.support:design:26.1.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/median1/AndroidStudioProjects/sora/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:(38, 13) Failed to resolve: com.android.support:appcompat-v7:26.1.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/median1/AndroidStudioProjects/sora/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:(39, 13) Failed to resolve: com.android.support:recyclerview-v7:26.1.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/median1/AndroidStudioProjects/sora/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
Error:(40, 13) Failed to resolve: com.android.support:cardview-v7:26.1.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/median1/AndroidStudioProjects/sora/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
,这些都是我的依赖
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:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:26.1.0'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.firebaseui:firebase-ui-database:0.4.2'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.sunfusheng:marqueeview:1.2.0'
compile 'com.google.firebase:firebase-storage:11.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-core:11.0.2'
testCompile 'junit:junit:4.12'
}
答
我要添加gradle这个,同步和对我的作品:
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.package.android"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
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:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.1.0'
...
希望它有助于,
我固定的家伙,我不知道它有一个选择依赖关系 –