2

I have wasted a full day, and am nowhere close to a solution.

This morning, I decided to add LeakCanary to check leaks in the android app we are developing. I usually work in offline mode as it speeds up builds. After adding it as a dependency, I disabled offline mode.

Within a minute I got an error saying -

Failed to resolve: com.android.support:appcompat-v7:25.0.0

Now currently, we are working with -

  1. compileSdkVersion 23
  2. buildToolsVersion "23.0.3"

and all our android support libraries, both v4 and v7, use 23.1.1

So I thought maybe the LeakCanary library internally uses 25.0.0, so I removed the library from build.gradle.

But the error persisted.

I have tried -

  1. Closing and restarting Android Studio.
  2. Closing and reopening the project in AS.
  3. Invalidating caches and restarting AS.
  4. Clean build.

In effect, my code is exactly similar to what it was yesterday when it was building and running properly, but today it just doesn't seem to go.

What may be the issue?

EDIT

Here is build.gradle -

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
repositories {
    maven {
        url "http://repo1.maven.org/maven2"
    }
    useLibrary 'org.apache.http.legacy'
}
defaultConfig {
    applicationId "com.example.pc.vision_test"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    multiDexEnabled true
    versionName "1.0"

}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/YouTubeAndroidPlayerApi.jar')

compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.apis:google-api-services-youtube:v3-rev149-1.20.0'
compile 'com.google.http-client:google-http-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-gson:1.20.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.amazonaws:aws-android-sdk-core:2.+'
compile 'com.amazonaws:aws-android-sdk-cognito:2.+'
compile 'com.amazonaws:aws-android-sdk-s3:2.+'
compile 'com.android.support:multidex:1.0.1'
compile 'commons-io:commons-io:2.4'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.5'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.github.shazrazdan:Elemento:0.9.7@aar'
compile 'com.afollestad.material-dialogs:core:0.8.6.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.github.bmarrdev:android-DecoView-charting:v1.2'
compile 'com.vimeo.networking:vimeo-networking:1.0.1'
compile 'com.roomorama:caldroid:3.0.1'
compile 'org.apache:pdfbox-android:1.8.9.0'
compile 'com.android.support:customtabs:23.1.1'
}
apply plugin: 'com.google.gms.google-services'

1 Answers1

1

As per my observation it seems like you haven't updated Android SDK platform and Android Build Tools to version 25. First of all download and install android sdk platform and build tools from SDK Manager and use the following lines in your build.gradle(module app)

compileSdkVersion 25
buildToolsVersion "25.0.0"

Also update dependencies according to that. It should work then

Rahul Sharma
  • 2,867
  • 2
  • 27
  • 40
  • @YugankaSharan try to delete the folder above then your desired build tools that is 23.0.3 from directory sdk/build-tools (in easy words delete 24.x.x & 25.x.x folder from build-tools) Also delete android-24 & android-25 from Sdk/Platform. Sync the project and try if it works – Rahul Sharma Nov 09 '16 at 04:10
  • That isn't the issue. I had downloaded android-24 a month back. And I don't have any 25.x.x folder in my build-tools folder. – Yuganka Sharan Nov 09 '16 at 06:20