我正在尝试更改“com.android.support:recyclerview”的版本。通常,当你想要更改android-support的版本时,你必须更改连接到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'
}
答案 0 :(得分:0)
我会添加我的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'
...
希望它有所帮助,