Ale*_*nin 7 android android-gradle-plugin rx-android rx-java2
野兔是我的应用程式:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.atumanin.testandroidannotations"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.1.18"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
}
Run Code Online (Sandbox Code Playgroud)
这是我的项目gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
如果我尝试构建项目,则会收到错误消息:
Could not resolve io.reactivex.rxjava2:rxjava:2.1.6.
Run Code Online (Sandbox Code Playgroud)
和
Could not resolve io.reactivex.rxjava2:rxandroid:2.0.1.
Run Code Online (Sandbox Code Playgroud)
我试图清理,重建项目并使缓存无效。没有任何帮助。我也尝试使用compile代替implementation。我也尝试了两个库的不同版本,但都没有成功。
我找到了解决方案。问题是我的代理,它阻止了https,我需要使用http存储库的版本。所以而不是:
repositories {
jcenter()
}
Run Code Online (Sandbox Code Playgroud)
我现在使用:
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
Run Code Online (Sandbox Code Playgroud)
现在就可以编译了。
| 归档时间: |
|
| 查看次数: |
5692 次 |
| 最近记录: |