Install RxHttp via kapt
masterTo use the kapt method, apply the kotlin-kapt plugin and ensure your project uses Java 8 or higher with the JitPack repository.
// 1. Project build.gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
// 2. Android build.gradle
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
// 3. Plugins and Dependencies
plugins {
id 'kotlin-kapt'
}
dependencies {
def rxhttp_version = '3.5.1'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation "com.github.liujingxing.rxhttp:rxhttp:$rxhttp_version"
kapt "com.github.liujingxing.rxhttp:rxhttp-compiler:$rxhttp_version"
}