Could not find support-v4.jar (com.android.support:support-v4:24.0.0)
Asked Answered
C

8

5

Error:A problem occurred configuring project ':app'.

Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/24.0.0/support-v4-24.0.0.jar

MY SDK Tool is like this image

enter image description here

And my Gradle is

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}



android {

    compileSdkVersion 24
    buildToolsVersion "24"

    dexOptions {
        javaMaxHeapSize "4g" //specify the heap size for the dex process
        preDexLibraries = false //delete the already predexed libraries
    }


    defaultConfig {
        applicationId "com.lionvisionsits.kkasons"
        minSdkVersion 19
        targetSdkVersion 24

        multiDexEnabled false

    }


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile('com.digits.sdk.android:digits:2.0.0@aar') {
        transitive = true;
    }
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:cardview-v7:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.android.support:recyclerview-v7:24.0.0'
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.google.android.gms:play-services:9.4.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'
    compile 'ch.acra:acra:4.9.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'me.relex:circleindicator:1.2.1@aar'
    compile 'com.github.arimorty:floatingsearchview:2.0.3'
    compile('com.digits.sdk.android:digits:2.0.0@aar') {
        transitive = true;
    }
    compile 'com.android.support:support-v4:24.0.0'
}

apply plugin: 'com.google.gms.google-services'

can anyone help me?

After Updating to v24.2.1 i get this error in debug\AndroidMenifest.xml enter image description here

Thanks & Regards Jay

Centralia answered 30/9, 2016 at 10:11 Comment(6)
Strange issue. This library is not in the jcenter but in a local maven repo.Try to update the SDK Manager and use compile 'com.android.support:support-v4:24.2.1Collegium
Thanks for reply. i tried 24.2.1 but it throws error in AndroidMenifest.xml .Let me send detail for that.Centralia
i Added screen shot...ple. look in to it @GabrieleMariottiCentralia
You can't use these attributes in the Manifest. They are added after building the apk,Collegium
Thanks man ..you are right i can not use them. Actually i had lost source code so i needed menifest so reverse engineered it and got that.Centralia
change google play service version.Melodeemelodeon
S
8

You need to do some changes in your build.gradle file inside platforms/android and need to add maven { url 'https://maven.google.com' } before the jcenter() as follows:

allprojects { 
  repositories { 
    mavenCentral()
    maven { url 'https://maven.google.com' } //add this code
    jcenter() 
 } 
}

This is now essential for new versions of google libraries. They moved their libraries out of the android SDK to the maven repo.

Sarsenet answered 9/7, 2018 at 7:31 Comment(1)
Thanks Sandy..You saved my day.Moving up google before jcenter works for me.Taveda
H
5

I had the same problem, i updated :

classpath 'com.android.tools.build:gradle:2.+'

and my gradle wrapper

distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

and it works

Housemother answered 13/10, 2016 at 15:48 Comment(0)
C
4

in my case in build.gradle file I had to add and reorder the repositories, such that jcenter is the last place where entry is searched for:

allprojects {
    repositories {
    mavenCentral() //+ added
    maven { url 'https://maven.google.com' } //^ moved up
    jcenter()
    }
}
Combustor answered 23/10, 2018 at 8:30 Comment(1)
@Sandy The difference is that I discover that even in case of entry already present, you should reorder them. If not stated, users cannot understand how to solve since the entryes can already be there, like in my caseCombustor
K
2

I was having the same issue, the following steps fixed my probelm. Give it try and see if it helps:

enter image description here

Go to "File" -> "Project Structure...".

Select "your project" under "Modules" and click on "Dependencies" tab.

Click on the "+" sign and select "1 Library dependency".

enter image description here

In the new popup window, select "support-v4" and click "OK".

Kress answered 8/11, 2016 at 0:53 Comment(0)
I
0

There is no use of buildVersionCode or name required in AndroidManifest.xml. You can better define it in app build.gradle file. Like below:

defaultConfig {
    applicationId "com.example.r"
    minSdkVersion 15
    versionCode 418
    versionName "4.4.0"

}
Icebound answered 30/9, 2016 at 12:43 Comment(0)
T
0

Maybe the version of com.android.support:support-v4:24.0.0 is different to the android studio. You can try to do like this: File-> project structure->app->dependencies->+->Library dependency, the select the com.android.support:support-v4:xx.x.x. If any problem, you can change the library to the lastest.

Teatime answered 20/10, 2016 at 4:35 Comment(0)
E
0

try this inside in android block

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_7
    targetCompatibility = JavaVersion.VERSION_1_7
}

Or if you have model block then try this

compileOptions.with {
    sourceCompatibility = JavaVersion.VERSION_1_7
    targetCompatibility = JavaVersion.VERSION_1_7
}
Edelstein answered 24/1, 2017 at 12:27 Comment(0)
P
-1

i have the same issue, and now i solve it. I have two place define "support-v4". one:maven { url "http://jcenter.bintray.com/" } because http://jcenter.bintray.com/com/android/support/support-v4/ define "support-v4" two:compile 'com.android.support:support-v4:+' I delete compile 'com.android.support:support-v4:+' in my module, then the project works. Appear this issue may be your project have two place that define "support-v4", so IDE don't known how to find the corrent one.

Pity answered 19/9, 2018 at 15:3 Comment(1)
This does not sound like an answer, or?Fluor

© 2022 - 2024 — McMap. All rights reserved.