0

when i use recycleview this error found Error:(34, 12) Failed to resolve: com.android.support:recycleview-v7:26.0.0 Install Repository and sync project
Show in File
Show in Project Structure dialog compile'com.android.support:recycleview-v7:26.0.0' and compile'com.android.support:recycleview-v7:26.0.0-alpha1' both i try but they all can't success. who can help me

this is gralde file: apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.example.exploapplication"
        minSdkVersion 21
        targetSdkVersion 26
        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:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.1'
    testCompile 'junit:junit:4.12'
    compile'com.squareup.okhttp3:okhttp:3.4.1'
    compile'com.google.code.gson:gson:2.7'
    compile'com.android.support:design:26.0.0-alpha1'
    compile'de.hdodenhof:circleimageview:2.1.0'
    compile'com.android.support:cardview-v7:26.0.0-alpha1'
    compile'com.android.support:recycleview-v7:26.0.0'
}

other gradle: // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven{
            url"https://maven.google.com"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

this is the content "D:\androidsdk\android-sdk-windows\extras\android\m2repository\com\android\support\recyclerview-v7"

uglyant
  • 95
  • 2
  • 9
  • Possible duplicate of [Failed to resolve: com.android.support:appcompat-v7:26.0.0](https://stackoverflow.com/questions/45357000/failed-to-resolve-com-android-supportappcompat-v726-0-0) – ישו אוהב אותך Oct 24 '17 at 03:12

1 Answers1

0

In your maven block:

give space between url & "https://maven.google.com"

It should look like: url "https://maven.google.com"

Next,

  1. Go to Android SDK from Android Stuido
  2. Click Show Package Details on bottom right corner
  3. Click Latest version of Android SDK Build-Tools, Android SDK Platform-Tools & Android SDK Tools (Look at attached screenshot)
  4. Install Android Support Repository & Google Repository if you haven't
  5. replace compile 'com.android.support:appcompat-v7:26.+'

with compile 'com.android.support:appcompat-v7:26.1.0'

  1. Replace compile'com.android.support:design:26.0.0-alpha1'

with compile'com.android.support:design:26.1.0'

  1. Replace compile'com.android.support:cardview-v7:26.0.0-alpha1'

with compile'com.android.support:cardview-v7:26.1.0'

  1. Replace compile'com.android.support:recycleview-v7:26.0.0'

with compile'com.android.support:recycleview-v7:26.1.0'

Android SDK

Sneh Pandya
  • 8,197
  • 7
  • 35
  • 50