Debbie
Debbie

Reputation: 969

Android: Failed to resolve: com.android.support:appcompat-v7:28.1.1

Error : Sync failed. Unresolved Android dependencies. Failed to resolve: com.android.support:appcompat-v7:28.1.1

Config:

 apply plugin: 'com.android.application'

    android {
        compileSdkVersion 28
        defaultConfig {
            applicationId "com.ercess.ercess_app1"
            minSdkVersion 15
            targetSdkVersion 28
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }



    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support.constraint:constraint-layout:1.1.2'
        implementation 'com.android.support:appcompat-v7:28.1.1'
        implementation 'com.squareup.picasso:picasso:2.71828'
        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'

    }

How to resolve this?

Upvotes: 5

Views: 30454

Answers (8)

Houssin Boulla
Houssin Boulla

Reputation: 2859

You need also add: implementation 'com.android.support:support-v4:28.0.0' in your gradle file like this:

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

and this is a full implementation:

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

Upvotes: 1

Martin Zeitler
Martin Zeitler

Reputation: 76569

you'd have to use api "com.android.support:appcompat-v7:27.1.1" -

or the later (future) api "androidx.appcompat:appcompat:1.0.2" from androidx.

using "release candidates" and "alpha versions" is discouraged, because these are not well tested.

just see the official documentation ...it recommends 27.1.1.

Upvotes: 2

Basile Perrenoud
Basile Perrenoud

Reputation: 4112

Many answers already on this one but I feel like noone explaines how to keep it up to date, just how to fix this specific version. So here it is

  • The com.android.support:appcompat version must match the compileSdkVersion
  • It is preferable to use stable versions if you release to production
  • Look on the android website to find the lastest stable version that correspond to your compile version (even is this link gets broken, the info will be available somewhere on the official website)

Example, as of today (end of january 2019), the lastest stable support library version is 28.0.0 (according to android website), so the correct implementation is

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

Upvotes: 5

Qasim
Qasim

Reputation: 5321

Replace

implementation 'com.android.support:appcompat-v7:28.1.1

with

implementation 'com.android.support:appcompat-v7:28.0.0-rc01'

Currently, the most recent available release for appCompat is 28.0.0-rc01, you are trying to pull an unavailable version of appcompat library.

Upvotes: 14

Ovalman
Ovalman

Reputation: 51

I solved this by trial and error and using some of the answers above.

I changed the appcompat to a lower version "com.android.support:appcompat-v7:27.1.0" along with changing

compileSdkVersion 27

and targetSdkVersion 27

I'm still getting warnings but Picasso should now run.

Upvotes: 1

Marco Tondini
Marco Tondini

Reputation: 162

replace

implementation 'com.android.support:appcompat-v7:28.1.1' 

with

implementation 'com.android.support:appcompat-v7:28.0.0-rc02'

Upvotes: 0

Please add these below dependencies to solve the issue, try it:

implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
implementation 'com.android.support:design:27.1.1'

also change the version of AppCompat as:

implementation 'com.android.support:appcompat-v7:27.1.1'

AppCompat Sometimes doesn't work alone. Adding these might solve your issue.

Upvotes: 0

Son Truong
Son Truong

Reputation: 14173

Root cause: The version 28.1.1 is not exist.

Solution: Use the latest stable version

implementation 'com.android.support:appcompat-v7:27.1.1'

or use latest unstable version

implementation 'com.android.support:appcompat-v7:28.0.0-rc01'

Upvotes: 6

Related Questions