0

I have an error that says

Faild to resolve: com.android.support:appcompat-v7:26.0.0

I upgraded my Android studio version to 3.0 Canary 8. Then, this error occurred.
and my project level gradle file is:

// 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:3.0.0-alpha8'
        classpath 'com.google.gms:google-services:3.1.0'

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

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
repositories {
    maven {
        url "https://maven.google.com"
    }
}

and my app level gradle file is:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "hojune.intelibag"
        minSdkVersion 17
        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(include: ['*.jar'], dir: 'libs')
    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'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.google.android.gms:play-services:11.0.4'
    compile 'com.android.support:appcompat-v7:26.0.0'
}
apply plugin: 'com.google.gms.google-services'

How can I do for this error?

Ho jun
  • 93
  • 1
  • 3
  • 9

3 Answers3

0

In your project-level build.gradle file, remove:

repositories {
    maven {
        url "https://maven.google.com"
    }
}

then change the allprojects closure in that file to look like:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

Update your Android Support Repository from SDK manager.

Vishal Vaishnav
  • 3,346
  • 3
  • 26
  • 57
0

Here you have '-alpha1' at the end

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

Write the same here

compile 'com.android.support:appcompat-v7:26.0.0' to 

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
Razvan
  • 292
  • 2
  • 3
  • 15