Alireza kherazani
Alireza kherazani

Reputation: 37

All dependencies faild to resolve?

My project was built and run correctly but since I updated Android Studio it gives these errors… and the offline work is unchecked.

ERRORS

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:multidex:1.0.3. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:design:26.1.0. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:cardview-v7:26.1.0. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:recyclerview-v7:26.1.0. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:appcompat-v7:26.1.0. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support.constraint:constraint-layout:2.0.0. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:support-compat:26.1.0. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.github.ybq:Android-SpinKit:1.1.0. Open File Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:appcompat-v7:26.1.0. Open File Show Details


Failed to resolve: com.android.support.test:runner:1.0.2 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support.test.espresso:espresso-core:3.0.2 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support:multidex-instrumentation:1.0.2 Open File Show in Project Structure dialog


Failed to resolve: com.android.support:multidex:1.0.3 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support:design:26.1.0 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support:cardview-v7:26.1.0 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support:recyclerview-v7:26.1.0 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support:appcompat-v7:26.1.0 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support.constraint:constraint-layout:2.0.0 Show in File Show in Project Structure dialog


Failed to resolve: com.github.ybq:Android-SpinKit:1.1.0 Show in File Show in Project Structure dialog


Failed to resolve: com.android.support:support-annotations:26.1.0 Open File Show in Project Structure dialog


Failed to resolve: android.arch.lifecycle:runtime:1.0.0 Open File Show in Project Structure dialog

MY GRADLE

apply plugin: 'com.android.application'

android {

    compileSdkVersion 26
    buildToolsVersion '28.0.2'
    defaultConfig {
        applicationId "com.example.radon.vitrin"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        multiDexEnabled true

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    useLibrary 'org.apache.http.legacy'
}


dependencies {
    implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
    implementation 'com.google.zxing:core:3.2.1'
    implementation files('libs/CircleImageViewmaster/gradle/wrapper/gradle-wrapper.jar')
    implementation files('libs/picasso-2.5.2(1).jar')
    implementation 'com.android.support:multidex:1.0.3'
    //noinspection GradleCompatible
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    //noinspection GradleCompatible
    //implementation 'com.google.android.gms:play-services:12.0.1'
    //noinspection GradleCompatible
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.android.support.constraint:constraint-layout:2.0.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:support-compat:26.1.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation('io.socket:socket.io-client:1.0.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
   // implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'
    implementation 'com.github.danylovolokh:video-player-manager:0.2.0'
    implementation 'com.zarinpal:purchase:0.0.8-beta'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
}

Upvotes: 0

Views: 399

Answers (2)

Alireza kherazani
Alireza kherazani

Reputation: 37

I found it ... just add jcenter() and google() as Yuenbe said .... and then start an vpn then build the project

Upvotes: 1

Yuenbe
Yuenbe

Reputation: 46

In your project .gradle (not the app module one), you are probably missing the Google repository. That's why the dependencies cannot be found.

buildscript {

    repositories {
        google() // <-- This is the line you must add
        jcenter()
    }
}

Upvotes: 1

Related Questions