skip to Main Content

Recently someone sent me one android project for training. I’m learning Android Studio, and when i want to build this project, it show this error message:

Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Could not find legacy-support-core-utils-1.0.0.jar (androidx.legacy:legacy-support-core-utils:1.0.0).
     Searched in the following locations:
         https://maven.google.com/androidx/legacy/legacy-support-core-utils/1.0.0/legacy-support-core-utils-1.0.0.jar

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

I searched for legacy-support-core-utils-1.0.0.jar and couldn’t find this in any repositories. This is first time i see this problem ever!

These are my dependencies:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.android.volley:volley:1.2.0'
    implementation platform('com.google.firebase:firebase-bom:28.2.0')
    implementation 'com.google.firebase:firebase-core'
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-database'
    implementation 'com.google.firebase:firebase-storage'
    implementation 'com.facebook.android:facebook-android-sdk:5.15.3'
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.hbb20:ccp:2.5.3'
    implementation 'com.google.android.gms:play-services-auth:19.0.0'
    implementation 'com.google.android.play:core:1.10.0'
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
    implementation 'com.github.CanHub:Android-Image-Cropper:3.1.2'
    implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
    implementation 'com.android.billingclient:billing:3.0.1'
    implementation "androidx.preference:preference:1.1.1"

    implementation 'org.jetbrains:annotations:15.0'
    def lifecycle_version = "2.0.0"
    //noinspection GradleDependency
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    //noinspection GradleDependency
    implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
    //noinspection LifecycleAnnotationProcessorWithJava8
    annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
    implementation('io.jsonwebtoken:jjwt:0.9.1')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
}
apply plugin: 'com.google.gms.google-services'

And my repositories in build.gradle:

buildscript {
    repositories {
        mavenCentral()
        maven {
            url 'https://mvnrepository.com/'
        }
        maven { url "https://jitpack.io" }
        maven { url "https://android.googlesource.com/" }
        maven { url "https://maven.fabric.io/public" }
        maven { url "https://raw.githubusercontent.com/2br-2b/Fdroid-repo/master/fdroid/repo/" }
        maven { url "https://mobileapp.bitwarden.com/fdroid/repo" }
        maven { url "https://fdroid.bromite.org/fdroid/repo/" }
        maven { url "https://fdroid.bromite.org/fdroid/repo/" }
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'https://maven.google.com'
        }
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.2'
        classpath 'com.google.gms:google-services:4.3.5'

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

}

allprojects {
    repositories {
        mavenCentral()
        maven {
            url 'https://mvnrepository.com/'
        }
        maven { url "https://jitpack.io" }
        maven { url "https://android.googlesource.com/" }
        maven { url "https://maven.fabric.io/public" }
        maven { url "https://raw.githubusercontent.com/2br-2b/Fdroid-repo/master/fdroid/repo/" }
        maven { url "https://mobileapp.bitwarden.com/fdroid/repo" }
        maven { url "https://fdroid.bromite.org/fdroid/repo/" }
        maven { url "https://fdroid.bromite.org/fdroid/repo/" }
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'https://maven.google.com'
        }
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

And my gradle-wrapper.properties file:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip

Can someone help me about this? How can i fix this problem?

2

Answers


  1. Update your Gradle and your matter will be solved by this

    Login or Signup to reply.
  2. just exclude androidx legacy support

    implementation ('com.mapbox.maps:android:10.7.0') {
        exclude group: 'androidx.legacy', module: 'legacy-support-core-utils'
        exclude group: 'androidx.interpolator', module: 'interpolator'
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search