failed to resolved support-vector-Drawable - android

I have project which was working fine till yesterday but this morning when i try to build it keeps throwing failed to resolved support-vector-Drawable error.
I try to clean and this error shows up
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find support-vector-drawable.aar (com.android.support:support-vector-drawable:26.0.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-vector-drawable/26.0.2/support-vector-drawable-26.0.2.aar
and here is my gradle
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.arizeh.arizehplus"
minSdkVersion 17
targetSdkVersion 22
multiDexEnabled true
versionCode 29
versionName "3.0.5"
useLibrary 'org.apache.http.legacy'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:26+'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
}
and here is my level build.gradle file
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.24.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'http://jhoobin.abroid.com/repo/' }
maven { url "https://jitpack.io" }
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Hi as per my understanding please try bellow tow thing one
One is replacing your app compact version dependancy with specific version else of plus
compile 'com.android.support:appcompat-v7:26+'
Replace with (Please set as per your build tool)
compile 'com.android.support:appcompat-v7:26.1.0'
And Another thing try updating your build tool version.

so after half day searching and rebuild finally it fixed by upgrading my compileSdkVersion and all other library to 27 ... I hope this help any one who has this problem

defaultConfig {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
Change to
defaultConfig {
vectorDrawables.useSupportLibrary = true
}

Related

Unable to resolve dependency for ':app#debug/compileClasspath':Could not resolve com.android.databinding:library:3.2.1

i am facing a problem with android studio 3.2.1 and the Gradle build version is 4.6. Recently i updated my android studio to 3.2.1 and and gradle is also updated to 4.6. If we remove the dataBinding, erors will be disappears. after adding the dataBinding its giving problem like
Unable to resolve dependency for ':app#debug/compileClasspath': Could
not resolve com.android.databinding:library:3.2.1.
Unable to resolve dependency for ':app#debug/compileClasspath': Could
not resolve com.android.databinding:adapters:3.2.1.
Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not resolve
com.android.databinding:library:3.2.1.
my Gradle build of the project level is
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
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/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
is any one solved this issues please help in this case.I have tried all the trials but did not worked.
my app level gradle is
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.sample.mvvmandroidstudio"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-
layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test.espresso:espresso-
core:3.0.2'
}
I made some edit in your gradle.
Project level
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App level
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.sample.mvvmandroidstudio"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
Changes I made:
Removed duplicate google repo
Removed testing dependencies, as I don't think you use it.
I resolved my issue by updating my android studio to recent version.
Thanks to Khemraj for your valuable time.
This can be fixed by uncheck the offline work in settings->Build,Execution Deployment->gradle.Hope it will help for you.

Failed to resolve: com.android.support:appcompat-v7:27.0.0

So, I built an app using targetSdkVersion 25, but then I realized that it's necessary to be higher than 26. I tried to upgrade it to API 27 and I am getting this error:
Error:(24, 13) Failed to resolve: com.android.support:appcompat-v7:27.0.0
Under this message there are three options:
Install Repository and sync project
Show in File Show in Project
Structure dialog
My build.gradle(Project):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.simon.onequoteaday"
minSdkVersion 14 //9
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-ads:11.0.0'
compile 'com.android.support:appcompat-v7:27.1.1'
}
I've also installed all API 27 SDK.
Any possible solutions? Thank you
Edit:
I've already used the solution provided by other threads but they don't solve my problem. I think my problem is different.
replace maven {url "https://maven.google.com"} with google(); the location has changed.
Change
buildtoolsversion '27.0.0'
and dependencies as:
compile 'com.android.support:appcompat-v7:27.0.0'
and stay connected to internet and download whatever repository it asks.
Hope it helps.
Installing the newest Android Studio version solved the problem

Android Studio IDE shows error on old dependencies but compiles and runs

I updated Android Studio gradle and compile SDK versions a few days ago in my project. Since then, the IDE started to show "Cannot resolve symbol 'Request'" on Volley and all old dependencies in the project but it still run correctly.
The problem is that it's annoying to see all my code in red when it's not having any error.
I'll show you my gradle files below:
app.gradle
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.myproject.android"
minSdkVersion 19
targetSdkVersion 27
versionCode 2
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.facebook.fresco:fresco:1.1.0'
}
project.gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
There was a problem on my gradle build. I just deleted .gradle folder and rebuilt project to solve it.

Failed to sync gradle project after adding Mapbox navigation SDK package.Its showing some irrelavant error [duplicate]

This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Closed 5 years ago.
Here is my gradle file. I am using Appcompat 25.3.1 version, but the error is on Appcompat 26.1.0. This error goes off when navigation SDK package is removed. I dont understand what is happening. Any help is greatly appreciated.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.aadhilahmed.test3"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories{
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.6.2' //error is here
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
And this is my error message:
Failed to resolve: com.android.support.appcompat-v7:26.1.0
Error:- Install repository and sync project.
Open file.
Show in Project Structure Dialog.
Even clicking on Install repository and sync project does absolutely nothing.
Add this inside your repositories block in your project level build.gradle file:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
This is the best way to do it.
In your root level gradle.build use below
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and in your gradle-wrapper.properties file change the wrapper version as below
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip
also in your app level build.gradle make sure you are using 26 vesion as below
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxxx"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

android studio - Gradle DSL method not found: 'compile()' Error:(36,0)

Hi people i have the following error on the title im so done of searching for a solution and still got nothing :'( this is a project for my company and it is 1 month of work please help me I really need my project back .
This is my build.gradle:
apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter() // or mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-alpha3'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "nunoalmeida.atphc"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
buildscript {
repositories {
jcenter() // or mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.+'
}
}
}
Replace this , it worked for me
classpath 'com.android.tools.build:gradle:2.2.0'
buildscript {
repositories {
jcenter() // or mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-alpha3'
}
}
cut this code from your module level build.gradle file and paste it to your project level build.gradle file.
it worked for me.
Download the Gradle distribution and read the "User Guide" PDF from top to bottom and save yourself the time that you'll spend asking questions.
If you do that, you'll find that buildscript dependencies are set with "classpath", not "compile".

Categories

Resources