【问题标题】:unresolved dependency for rxjava cannot download rxjava.jarrxjava 的未解决依赖项无法下载 rxjava.jar
【发布时间】:2018-09-20 19:00:10
【问题描述】:

我从未使用过这个库。它无法正确同步,但我的互联网运行良好,可以下载该 .jar 文件

这是我的错误:

无法解析 ':app@debug/compileClasspath' 的依赖关系:无法下载 rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
打开文件
显示详情

无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法下载 rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
打开文件
显示详情

无法解析“:app@debugUnitTest/compileClasspath”的依赖关系:无法下载 rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
打开文件
显示详情

无法解析 ':app@release/compileClasspath' 的依赖关系:无法下载 rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
打开文件
显示详情

无法解析 ':app@releaseUnitTest/compileClasspath' 的依赖关系:无法下载 rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
打开文件
显示详情

这是我的 build.app gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.tekemuradov.aman.ulgmada"
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // implement support libraries
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:animated-vector-drawable:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:27.0.2'

    // implement firebase libraries
    implementation 'com.google.firebase:firebase-auth:11.0.4'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.google.firebase:firebase-storage:11.0.4'
    implementation 'com.google.firebase:firebase-core:11.0.4'

    // implement firebase-ui
    implementation 'com.firebaseui:firebase-ui-database:2.3.0'

    // implement lifecycle
    implementation 'android.arch.lifecycle:extensions:1.1.0'

    // implement circle image view
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    // implement image cropper
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'

    // implement image compressor
    implementation 'id.zelory:compressor:2.1.0'

    // implement test
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'


}



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

configurations.all{
    resolutionStrategy.eachDependency{DependencyResolveDetails details ->
        def requested = details.requested
        if(requested.group == 'com.android.support'){
            if (!requested.name.startsWith("multidex")){
                details.useVersion('27.0.2')
            }
        }
    }
}

这是我的 build.project gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'




        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.1.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

【问题讨论】:

    标签: java android android-studio rx-java rx-java2


    【解决方案1】:

    使用

    implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
    

    来自https://github.com/ReactiveX/RxJava/issues/5794

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-09
      • 2017-11-12
      • 2012-01-12
      • 1970-01-01
      • 2020-03-28
      • 2020-10-04
      • 2022-06-21
      • 2018-05-13
      相关资源
      最近更新 更多