Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.0.0-beta1

Tags:

android

I had android studio 2.3.3 and i install android studio 3.0.1. I can't sync project

This is my error:

E:\AndroidProject\...\app\build.gradle
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.0.0-beta1. Open File Show Details

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.0.0-beta1.

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.0-beta1. 
....

MY app build.gradle

    apply plugin: 'com.android.application'
            android {
        compileSdkVersion 26
        buildToolsVersion '26.0.2'
        defaultConfig {
            applicationId "com.avana.xxx"
            minSdkVersion 14
            targetSdkVersion 26
           ...
        }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support.constraint:constraint-layout:1.1.0-beta1'
    compile 'com.android.support:appcompat-v7:26.0.0-beta1'
    compile 'com.android.support:cardview-v7:26.0.0-beta1'
    compile 'com.android.support:design:26.0.0-beta1'
}

build.gradle

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

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

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

gradle.wrapper

  distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
like image 727
user5082704 Avatar asked Dec 23 '17 13:12

user5082704


1 Answers

Goto setting->build->gradle and then uncheck offline-work button. Then rebuild you program.

Here's the same problem as yours

like image 164
Zacks Avatar answered Oct 17 '22 11:10

Zacks