Brijender Kumar
Brijender Kumar

Reputation: 39

Android Gradle project sync failed due to unresolved dependency

I recently added a card-stack-view dependency (implementation 'com.yuyakaido.android:card-stack-view:2.3.4') to my app level build.gradle and after that my project is giving syncing failure like:-

ERROR: Failed to resolve: androidx
Affected Modules: app

This is my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.animeapp.brijender.myapp"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:run ner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.miguelcatalan:materialsearchview:1.4.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.yuyakaido.android:card-stack-view:2.3.4'
}

Can anyone help what i might be doing wrong?

Upvotes: 2

Views: 1390

Answers (4)

Assavamet Patike
Assavamet Patike

Reputation: 1

repositories {
    google()
    mavenCentral()
    
    maven {
        setUrl("https://jitpack.io")
    }
   
    implementation ("com.github.yuyakaido:CardStackView:v2.3.4") 

Add Maven Jitpack and implementation to the build.gradle, it worked for me.

Upvotes: 0

M1NT
M1NT

Reputation: 1

Just add this line to your properties.gradle -> android.enableJetifier=true. Good luck

Upvotes: 0

Hamzeh Kabuli
Hamzeh Kabuli

Reputation: 86

Just add jCenter repository in project’s build.gradle (or if you are using the new way just add it in your settings.gradle)

pluginManagement {
  repositories {
    gradlePluginPortal()
    google()
    mavenCentral()
  }
}
dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    google()
    mavenCentral()
    jcenter()
  }
}

include ':app'

Upvotes: 6

Brijender Kumar
Brijender Kumar

Reputation: 39

Just Needed to remove these dependencies androidTestImplementation 'androidx.test:run ner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

Upvotes: 0

Related Questions