android {
compileSdkVersion30
buildToolsVersion"30.0.3"
defaultConfig {
applicationId"com.*.*"
minSdkVersion23
targetSdkVersion30
versionCode1
versionName"1.0"
testInstrumentationRunner"androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabledfalse
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
}
}
dataBinding{
enabledtrue
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir:'libs',include: ['*.jar'])
implementation'androidx.appcompat:appcompat:1.0.2'
implementation'com.google.android.material:material:1.0.0'
implementation'androidx.constraintlayout:constraintlayout:1.1.3'
implementation'androidx.navigation:navigation-fragment:2.0.0'
implementation'androidx.navigation:navigation-ui:2.0.0'
implementation'androidx.lifecycle:lifecycle-extensions:2.0.0'
testImplementation'junit:junit:4.12'
androidTestImplementation'androidx.test.ext:junit:1.1.0'
androidTestImplementation'androidx.test.espresso:espresso-core:3.1.1'
//NoSuchMethodError for FragmentManager.getFragmentFactory
implementation"androidx.fragment:fragment:1.1.0-alpha01"
//解决Glide找不到Android声明库问题
annotationProcessor'androidx.annotation:annotation:1.0.0'
implementation'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor'com.github.bumptech.glide:compiler:4.9.0'
//recycleview
implementation'androidx.recyclerview:recyclerview:1.1.0'
//Rxjava
//处理网络请求在android中线程调度问题
implementation'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation"io.reactivex.rxjava3:rxjava:3.0.4"
//Retrofit
implementation'com.squareup.retrofit2:retrofit:2.9.0'
//支持Gson解析
implementation'com.squareup.retrofit2:converter-gson:2.9.0'
//Retrofit打印请求参数
//Retrofit中无法打印请求参数,由于Retrofit是基于OkHttp进行封装的,可以对OkHttp添加日志拦截器来打印请求参数:
//使用拦截器的版本要和retrofit使用的okhttp3的版本
implementation'com.squareup.okhttp3:logging-interceptor:3.8.0'
//衔接 Retrofit & RxJava
implementation'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
// 集成androidAutoSize屏幕适配
implementation'me.jessyan:autosize:1.1.2'
//跨线程通信采用eventbus 或 用rxjava 代码实现
// implementation 'org.greenrobot:eventbus:3.1.1'
}
网友评论