potatoCatz
potatoCatz

Reputation: 107

ERROR: Failed to resolve: androidx.legacy:legacy-support-v4

After migrating to androidx this error kept showing, can anyone help me with it?

Here's part of the build.gradle


buildscript {
    repositories {
        google()
        maven {
            url 'https://maven.google.com'
        }
        jcenter()


    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        maven {
            url 'https://maven.google.com'
        }
        jcenter()

    }
}

here's the list of dependencies in build.gradle(app)

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'androidx.legacy:legacy-support-v4'
    //implementation 'androidx.legacy:legacy-support-v13'
    testImplementation 'junit:junit:4.12'

    androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
}

this is the single line of error when I try to sync project

ERROR: Failed to resolve: androidx.legacy:legacy-support-v4:
Affected Modules: app

Upvotes: 3

Views: 7205

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363975

Use

implementation 'androidx.legacy:legacy-support-v4:1.0.0'

instead of

implementation 'androidx.legacy:legacy-support-v4'

Upvotes: 3

Related Questions