Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1
P

6

9

I have already referred to this thread but it does not resolve my issue.

I keep getting the error: ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1 in Android Studio every time I try to refresh Gradle.

Here is my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.1"
    defaultConfig {
        applicationId "com.application.app"
        minSdkVersion 14
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:29.0.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'
}

How can I fix it and also is there a website where all the version of all the android modules are listed? I could not find any myself.

Thanks.

Pitsaw answered 13/7, 2019 at 19:10 Comment(1)
Add your app/build.gradle for people to see. Only verbal error is worth nothing if you don't show others where you must've made a mistake.Deguzman
I
10

It happens because com.android.support:appcompat-v7:29.x.x doesn't exist.

You can check the revision history in the official doc.

You can:

  • Use the last 28.0.0 release of the support library
  • migrate to androidx

Also check this note:

Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.

You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

Intended answered 13/7, 2019 at 20:13 Comment(0)
F
5

Replace implementation 'com.android.support:appcompat-v7:29.0.1' with implementation 'androidx.appcompat:appcompat:1.0.2'

Footstone answered 18/7, 2019 at 19:46 Comment(0)
M
4

I suggest you migrate to AndroidX

Go to Refactor > Migrate to AndroidX > Migrate

com.android.support:appcompat-v7:29.0.1 doesn't exist

Malignity answered 14/7, 2019 at 2:33 Comment(1)
Great point ! I wonder how come this only had 1 up-vote so far.. Thank you !Ambriz
N
2

There is no support library for 29 you have to use androidx support library packages for new developments

from the Docs

This is the stable release of Support Library 28.0.0 and is suitable for use in production. This will be the last feature release under the android.support packaging, and developers are encouraged to migrate to AndroidX.

Neurosis answered 13/7, 2019 at 19:15 Comment(2)
So what change do I have to do to fix that in my case?Pitsaw
try using androidx artifacts here is the linkNeurosis
A
0

Use this to your build.gradle (:app)

put before :

dependencies {

this hack solve my problem:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0'
            }
        }

    }
}
Alliaceous answered 28/2, 2021 at 6:10 Comment(0)
A
-1

// migrating existing projects to AndroidX

//@link::https://developer.android.com/topic/libraries/support-library/packages

With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.

AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

Android Studio

GO TO Refactor >> Refactor this >> migarat to AndroidX

The following table lists the current mappings from the old support library packages to the new androidx packages.

@link https://developer.android.com/jetpack/androidx/migrate/class-mappings @link https://developer.android.com/jetpack/androidx/migrate/artifact-mappings

Each version of an AndroidX library passes through four release channels while being developed.

@link https://developer.android.com/jetpack/androidx/versions/all-channel

Aneto answered 12/2, 2020 at 10:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.