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
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With