1

I got this error when try to add dependancy on module.

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project/

Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project

Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project

Error:Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project**

Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project**

please help to resolve this problem.

Methods i have tried:

1.I have tried gradle offline work and online work, both end up with same error message.

2.Clean project & rebuilding.

3.INVALIDATE CACHE & RESTART.

//Edit

Following is my app level gradle:

 apply plugin: 'com.android.application'

 android {
     compileSdkVersion 26
 buildToolsVersion '26.0.2'

 defaultConfig {
     applicationId "com.XXX.XXXXXXXX"
     minSdkVersion 19
     targetSdkVersion 25
     versionCode 1
     versionName "3.0"
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
     multiDexEnabled true
     //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 }
 buildTypes {
     release {
         minifyEnabled false
         proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
     }
 }
 packagingOptions {
     exclude 'META-INF/LICENSE'
     exclude 'META-INF/LICENSE-FIREBASE.txt'
     exclude 'META-INF/NOTICE'
 }
 dexOptions {
     jumboMode true
     //matchingFallbacks = ['release', 'debug']
 }
 //configurations.all {
 //    resolutionStrategy.force 'com.google.code.findbugs:jsr305:26.0.2'
 //} }

repositories {
 /*maven {
     url "https://jitpack.io"
 }*/
 mavenCentral()
 maven() {
     url "https://oss.sonatype.org/content/repositories/snapshots"
 } }

dependencies {
 implementation files('libs/httpclient-4.5.3.jar')

 implementation project(':videocompress')


 implementation 'com.google.firebase:firebase-analytics:11.2.0'
 implementation 'org.apache.commons:commons-io:1.3.2'
 implementation 'com.google.firebase:firebase-analytics:11.2.0'
 implementation 'com.github.bumptech.glide:glide:4.1.1'
 implementation 'de.hdodenhof:circleimageview:2.2.0'
 implementation 'com.google.android.gms:play-services-auth:11.2.0'
 implementation 'com.google.firebase:firebase-database:11.2.0'
 implementation 'com.google.firebase:firebase-storage:11.2.0'
 implementation 'com.google.firebase:firebase-auth:11.2.0'
 implementation 'com.google.firebase:firebase-config:11.2.0'
 implementation 'com.google.android.gms:play-services-appinvite:11.2.0'
 implementation 'com.google.firebase:firebase-messaging:11.2.0'
 implementation 'com.google.android.gms:play-services-ads:11.2.0'
 implementation 'com.google.firebase:firebase-appindexing:11.2.0'
 implementation 'com.google.firebase:firebase-crash:11.2.0'
 implementation 'com.firebaseui:firebase-ui-database:1.2.0'
 implementation 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
 implementation 'com.google.code.gson:gson:2.2.4'
 implementation 'com.squareup:otto:1.3.8'
 implementation 'com.squareup.picasso:picasso:2.5.2'
 implementation 'id.zelory:compressor:1.0.4'
 implementation 'com.commit451:PhotoView:1.2.4'
 implementation 'com.yovenny.VideoCompress:videocompress:1.0.0'
 implementation 'com.android.support.constraint:constraint-layout:1.0.2'
 implementation 'me.aflak.libraries:pulltorefresh:1.0'
 implementation 'com.android.support:cardview-v7:26.0.0-alpha1'
 implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'
 implementation 'com.android.support:design:26.0.0-alpha1'
 testCompile 'junit:junit:4.12'
 annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'
 implementation 'me.relex:circleindicator:1.2.2@aar'
 implementation 'com.github.lawloretienne:imagegallery:0.1.0'
 implementation 'com.jakewharton:butterknife:8.4.0'
 annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
 implementation 'com.android.support:palette-v7:26.0.0-alpha1'


 implementation 'com.android.support:multidex:1.0.1'

 implementation 'com.baoyz.swipemenulistview:library:1.3.0'
 implementation ('com.github.worker8:tourguide:1.0.17-SNAPSHOT@aar') {
     transitive=true
 }


 compile project(path: ':calapp') }


apply plugin: 'com.google.gms.google-services'
Sushin Pv
  • 1,826
  • 3
  • 22
  • 36
Vasu
  • 886
  • 2
  • 11
  • 28

1 Answers1

0

Try: in build.gradle(app)

    android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.application"
        minSdkVersion 19
        targetSdkVersion 26
        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:appcompat-v7:**26.1.0**'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso- 
core:3.0.1'
}

in build.gradle(project) change gradle dependency version to

classpath 'com.android.tools.build:gradle:3.0.1'

In gradle-wrapper.properties, change distributionUrl with below line

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Chirag Desai
  • 83
  • 1
  • 8