android - 找不到 support-v4.jar (com.android.support :support-v4:24. 0.0)

标签 android android-studio support-v4

错误:配置项目“: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

我的 SDK 工具就像这个图片

enter image description here

我的 Gradle 是

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'

谁能帮我吗?

更新到 v24.2.1 后,我在 debug\AndroidMenifest.xml 中收到此错误 enter image description here

感谢和问候 周杰伦

最佳答案

您需要在platforms/android中的build.gradle文件中进行一些更改,并且需要添加maven { url ' https://maven.google.com ' } 在 jcenter() 之前,如下所示:

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

这对于新版本的 Google 库来说至关重要。他们将库从 android SDK 移至 Maven 存储库。

关于android - 找不到 support-v4.jar (com.android.support :support-v4:24. 0.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51231311/

相关文章:

android-studio - 如何从工作室中排除 support v4 库?

android - 音频流的最佳实践

android - 在自动完成 TextView android中添加永久搜索标题

java - Android Recycler View notifyItemRemoved 动画中断

android - Android 模拟器中不支持的虚拟 SD 卡

android - 在Android上构建Rust

android - 在 Android Studio 中显示文本有什么问题?

java - Android 项目构建成功但运行失败,错误为 : java. util.zip.ZipException:重复条目

java - 意外的最高级别异常:错误:com.android.dx.cf.iface.ParseException:错误的类文件魔术(cafebabe)或版本(0034.0000)android studio

Android:强制gradle只包含一个版本的库