Could not resolve com.android.support:design 28.0.0
Asked Answered
D

6

5

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

Dwan answered 9/1, 2019 at 17:6 Comment(1)
I solved this issue.Its need open internetDwan
D
5

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.+'
Disharmonious answered 14/4, 2019 at 0:12 Comment(0)
C
2

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

Caput answered 10/1, 2019 at 11:27 Comment(0)
C
1

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

Cupp answered 28/2, 2019 at 11:58 Comment(0)
J
0

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'
Jaquelynjaquenetta answered 9/1, 2019 at 17:23 Comment(1)
I updated eventhough its showing same issue.Please help me .IDwan
G
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.

Gaff answered 10/1, 2019 at 11:35 Comment(16)
Yes by mistake i given wrongly in my question,I editted the code.I given this com.android.support:design:28.0.0 plugin only in gradle file.I restarted,cleared caches eventhough its not working.I have given proxy in setting and gradle file its not wworking so again i changed to auto proxy and removed from gradle.I tired all ways but i dont know where i did mistake.Dwan
make sure you have downloaded sdk platform for api 28 from sdk managerGaff
By mistake i given 28.0.8 in my post but in my gradle i have 28.0.0 version onlyDwan
Yes its downloaded already thats why in project structure -dependencies-its showing alll new versions only 28.0.0.Dwan
I understood that, but check from sdk manager that you have api 28 downloaded, check version and make sure you have api 28 platform downloadedGaff
app-compact-28.0.0 is added by default when creating new project know so its not giving any issue.But if i added any dependencies 28,27 version means its showing issues.Dwan
do you by any chance have enabled offline gradle?Gaff
I attached the sdk manager scrrenshto,i updated 28sdk only..Yes I unchecked the offline in gralde.I tried already but still its not fixed.Dwan
also check whether you have actually downloaded build tools 28.0.3 from sdk manager -> sdk tools tab -> android sdk build tools - > check it and select show package details box on right bottom and see that 28.0.3 is showing installed.Gaff
More security problem here due to that ,this issues are coming ah.I dont know .Please help meDwan
same thing once happened to me because support staff blocked url for gradle to download those dependencies. make sure you are able to access them by manually open this in your browser. dl.google.com/android/repository/…Gaff
Yes i attached sdktools tab screenshot also.28.0.3 version is installed. Thats why i dont know why still its not solved.I tried whatever solutions is available and installed latest version evnthough its not yest solvedDwan
Yes your link is downloaded,using that what i have to doDwan
I have one doubt sdk/extras/android/respostirt/library/support in that folders upto 26.0.0 alpha only showing not only for support,For all library ex recyclerview,cardview,appcompact. We have to download new version how is possible by default its downloaded right. but app-compact-28.0.0 working only ,Dwan
can you remove those and install them again, it might be due to android studio caching problem.Gaff
Your link is download but showing invalid corrupted file.Dwan
C
0

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.

Corm answered 11/3, 2019 at 18:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.