首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Unable to resolve dependency for问题?

Unable to resolve dependency for问题?

提问于 2018-08-20 16:07:02
回答 1关注 1查看 2.6K

报错信息:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@release/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

以下是我的代码内容:

app目录下的build.gradle文件:

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.uratio.rxjavademo2"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.+'
    implementation 'com.android.support:design:28.+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
//    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
//    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
}

项目目录下的build.gradle文件:

代码语言:javascript
复制
// 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.1'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

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

gradle-wrapper.properties文件内容:

代码语言:javascript
复制
#Wed Aug 15 16:44:09 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

这个问题该怎么解决,好像是现在这个配置,导入什么框架都会报错,搜了网上的错误,没有一个和我的报错完全一样的(除了框架名不同),求解答!

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档