Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not resolve com.android.support:design 28.0.0

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

like image 549
kalai Avatar asked Jan 09 '19 17:01

kalai


3 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.+'
like image 192
Eng. Samer T Avatar answered Oct 27 '22 09:10

Eng. Samer T


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

like image 27
Rajaji Subramanian Avatar answered Oct 27 '22 09:10

Rajaji Subramanian


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

like image 44
Rachid Rajjys Avatar answered Oct 27 '22 09:10

Rachid Rajjys