Could not resolve com.android.support:design 28.0.0

Viewed 17101

I am getting below error in my new Android studio version, when I want add floating EditText. I need to add this android.support.design library if I add this in gradle file

This is errors which i'm getting in logcat

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

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:design-v7:28.0.0. Open File Show Details

Note: I referred more links I tried all solutions even though I didn't get solution.

I already unchecked offline work in gradle. I added maven also in gradle file and cleaned, rebuilded the project even-though I didn't get solutions.

This is gradle file:

apply plugin: 'com.android.application'    

repositories {
    maven { url "https://jitpack.io" }


}    

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "fadila.new_tech.app"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 6
        versionName "1.5"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')

    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'

}

This is Gradle(PRjoect module)

buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com' //put it here
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'


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

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com' //put it here
        }
    }
}

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

See Sdk Manager image I already updated 28 version enter image description here enter image description here

6 Answers

You can try to compile the package using plus sign

implementation 'com.android.support:design:28.0.+'

or

implementation 'com.android.support:design:28.+'

However google changed the package name, all packages mapping here

All new Support Library development will occur in the AndroidX library

so you have to use

implementation 'com.google.android.material:material:1.0.0'

instead of

implementation 'com.android.support:design:28.0.+'

Close Your Android studio first and then please goes to "C:/Users/" then deleting .android ,.gradle and .AndroidStudio folders.This will delete all current android settings. After the delete process completion you go and then open the studio, when you open the android studio again it will ask for the download dependencies by automatically.

Once Download complete please build your project. it will work.

files

For me this happened because for some reasons i activated the offline work. In order to solve this issue i had to deactivate it by going to File>Settings and then selecting the Build, Execution, Deployment option from the left side of the Settings window. Now click on the Gradle option and then you can see the Offline Work which you can uncheck if it is checked.

But,above all don't forget to check your internet connexion

You can try upgrading this these dependencies:

 implementation 'com.android.support:support-v4:27.0.2'
 implementation 'com.android.support:appcompat-v7:27.0.2'
 implementation 'com.android.support:design:27.0.2'

to:

implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'

You are having wrong dependency in your gradle

com.android.support:design:28.0.8

latest version current is

com.android.support:design:28.0.0

The version you have used doesn't exist and thus it is producing errors.

Change your dependency to what I have mentioned earlier i.e to version 28.0.0 clean and build your project, If it does not work invalidate caches and restart your andorid studio.

Just disabling the offline mode resolved the issue for me.

Mind you, at the time I am typing this, the latest design library is 28.0.0.

Related