报错信息:
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文件:
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文件:
// 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文件内容:
#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
这个问题该怎么解决,好像是现在这个配置,导入什么框架都会报错,搜了网上的错误,没有一个和我的报错完全一样的(除了框架名不同),求解答!
相似问题