'Could not find io.reactivex.rxjava2:rxandroid:2.2.20
This is my project and I am trying to use this rxjava library. At the beginning, I added the required dependencies it is being synced without any fault but when I rebuilt the project it did not work. Here is my build gradle:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'androidx.navigation.safeargs.kotlin'
id 'kotlin-kapt'
id 'kotlin-android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.cerentekin.countrylist"
minSdk 23
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
def lifeCycleExtensionVersion = '1.1.1'
def supportVersion = '28.0.0'
def retrofitVersion = '2.9.0'
def glideVersion = '4.12.0'
def rxJavaVersion = '2.2.20'
def roomVersion = '2.4.2'
def navVersion = '2.4.1'
def preferencesVersion = '1.2.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "android.arch.lifecycle:extensions:$lifeCycleExtensionVersion"
//noinspection GradleCompatible
implementation "com.android.support:palette-v7:$supportVersion"
//noinspection GradleCompatible
implementation "com.android.support:design:$supportVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
implementation "com.github.bumptech.glide:glide:$glideVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"
implementation "androidx.room:room-runtime:$roomVersion"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
kapt "androidx.room:room-compiler:$roomVersion"
implementation "androidx.room:room-ktx:$roomVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
implementation "androidx.navigation:navigation-fragment-ktx:$navVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navVersion"
implementation "androidx.preference:preference:$preferencesVersion-ktx"
implementation "com.google.android.material:material:1.5.0"
}
I have tried rxjava library for the first time but the project is not being synced." Could not find io.reactivex.rxjava2:rxandroid:2.2.20. " it gives me this fault.
Solution 1:[1]
You're using the same version for rxjava and rxandroid, two different libraries
The latest rxandroid version is 2.1.1 not 2.2.20
You can check the latest versions of libraries that are uploaded to maven by searching the maven repository
For example the rxandroid2 versions can be found listed here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mustafa Dakhel |
