Android Studio: Gradle Sync fail with support-v4-24.1.1.jar
Asked Answered
H

5

7

I am getting gradle issue . here is below issue in gradle message, while doing sync in gradle Our Android Studio version is 2.1.2.

Error:A problem occurred configuring project ':LetMeCall_Store'. Could not find support-v4.jar (com.android.support:support-v4:24.1.1). Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/24.1.1/support-v4-24.1.1.jar

Below is gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.app.letmecall.store"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.android.support:design:24.0.0-beta1'
    compile 'com.android.support:support-v4:24.0.0-beta1'
    compile 'com.android.support:recyclerview-v7:24.1.1'
    compile 'com.android.support:cardview-v7:24.0.0-beta1'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'com.loopj.android:android-async-http:1.4.6'
    compile 'com.daimajia.androidanimations:library:1.0.3@aar'
    compile "com.google.android.gms:play-services:8.3.0"
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.android.support:multidex:1.0.0'
}

Plz anyone help us to fix that issue Advance thanks

Headset answered 30/9, 2016 at 5:25 Comment(3)
There is another gradle.build file in your project that is for application level.Try putting compile 'com.android.support:support-v4:24.0.0-beta1' in other build.gradle fileHyperparathyroidism
In application level.this is my gradle file buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } in this wr i need to add that lineHeadset
We find out the issue, Updated SDK manager. changed 24.0.0 to 24.2.0Headset
E
4

I upgraded all my Android SDK tools (including "Support Repository"), however, I still got the error

Gradle sync failed: Could not find recyclerview-v7.jar (com.android.support:recyclerview-v7:24.1.1)

I then did the following :

  1. targetSdk 24 (was 23)
  2. buildToolsVersion: "24.0.3" (was 24.0.0)
  3. deleted the folders within /.gradle/caches I have windows and the complete path is C:\Users\USERNAME\.gradle\caches

THEN the project built without error !!

Exertion answered 24/10, 2016 at 17:35 Comment(0)
C
2

Change this

compile 'com.android.support:design:24.0.0-beta1'
compile 'com.android.support:support-v4:24.0.0-beta1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.0.0-beta1'

to this

 compile 'com.android.support:design:24.1.1'
    compile 'com.android.support:support-v4:24.1.1'
    compile 'com.android.support:recyclerview-v7:24.1.1'
    compile 'com.android.support:cardview-v7:24.1.1'

you have to use same version.

Cockayne answered 30/9, 2016 at 5:41 Comment(6)
after changing that, getting same issueHeadset
@NareshKoppera did you clean the project.Cockayne
@NareshKoppera try to change buildToolsVersion "24.0.1" to buildToolsVersion "24.1.1" then check.Cockayne
We find out the issue, Updated SDK manager. changed 24.0.0 to 24.2.0Headset
@NareshKoppera How do you update the "SDK Manager" ?Exertion
@SomeoneSomewhere check out this link. developer.android.com/topic/libraries/support-library/…Cockayne
N
0
Replace with these


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.stackdemo"
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'

    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'com.loopj.android:android-async-http:1.4.6'
    compile 'com.daimajia.androidanimations:library:1.0.3@aar'
    compile "com.google.android.gms:play-services:8.3.0"
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.android.support:multidex:1.0.0'


}
Nashville answered 30/9, 2016 at 5:34 Comment(0)
D
0

I have the same issue and once i update Build tool version and android studio. Issue is resolved. Defiantly it is due to older build tool version.

Dacron answered 4/10, 2016 at 9:12 Comment(0)
P
0

I had this issue with a sample project from Android Developers. I updated all of the libraries in. the gradle file to latest versions then cleaned & rebuilt the project. All is working fine now.

Probably a good idea to make sure all of your sdk's are up to date too

Pris answered 10/10, 2016 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.