plugins { id 'com.android.application' } android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.example.tidalairpeisong" minSdkVersion 16 targetSdkVersion 30 versionCode 1 versionName "1.0" multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { arguments = [ //使用asXxx方法时必须,传入你依赖的RxJava版本 rxhttp_rxjava: '3.1.1', ] } } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.material:material:1.2.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.1' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'com.squareup.okhttp3:okhttp:4.9.1' implementation 'com.github.liujingxing.rxhttp:rxhttp:2.6.8' annotationProcessor 'com.github.liujingxing.rxhttp:rxhttp-compiler:2.6.8' //生成RxHttp类,纯Java项目,请使用annotationProcessor代替kapt //rxjava2 // implementation 'io.reactivex.rxjava2:rxjava:2.2.8' // implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' // implementation 'com.github.liujingxing.rxlife:rxlife-rxjava2:2.2.1' //管理RxJava2生命周期,页面销毁,关闭请求 //rxjava3 implementation 'io.reactivex.rxjava3:rxjava:3.1.1' implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' implementation 'com.github.liujingxing.rxlife:rxlife-rxjava3:2.2.1' //管理RxJava3生命周期,页面销毁,关闭请求 implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.squareup.retrofit2:retrofit:2.9.0' //日志的拦截器 implementation 'com.squareup.okhttp3:logging-interceptor:4.9.2' }