中文
android.enableAapt2=false
Gson 依赖 需要联网下载
implementation 'com.google.code.gson:gson:2.2.4'
侧滑菜单 /TabLayout依赖
implementation 'com.android.support:design:27.1.1'
recyclerview 依赖
implementation 'com.android.support:recyclerview-v7:27.1.1'
xrecyclerview
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
卡片布局
implementation 'com.android.support:cardview-v7:27.1.1'
banner轮播图
implementation('com.android.support:design:27.1.1')
implementation'com.youth.banner:banner:1.4.10'
OkHttp
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
Retrofit
//Retrofit依赖
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
// 可选依赖,解析json字符所用
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
加载图片 gilde
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
Rxjava
//rxjava
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
//rxandroid
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
Rxjava和Retrofit结合
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.0'
butterknife
implementation 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
EventBus
implementation 'org.greenrobot:eventbus:3.1.1'
解决依赖导入过慢(依赖仓库)
在build.gradle (project)-buildscript-repositories-google()下方 复制如下代码:
maven { url "https://jitpack.io" }
maven { url "https://mvnrepository.com" }
// 阿里云镜像
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
//OSChina仓库
maven { url 'http://maven.oschina.net/content/groups/public/' }
解决依赖冲突 直接在导入依赖后放在最下面 版本可以更改
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}