图片加载库添加
1. 使用 Maven Central 或 JCenter(推荐)
// Project-level build.gradle allprojects { repositories { google() mavenCentral() // 添加 Maven Central 仓库 jcenter() // 如果需要,还可以使用 JCenter } }// app/build.gradle dependencies { implementation 'com.github.bumptech.glide:glide:4.13.0' // Glide 库 annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0' // Glide 编译器(用于生成缓存和其他处理) }// 例如,Picasso 库 dependencies { implementation 'com.squareup.picasso:picasso:2.8' }
2. 使用 AAR 文件(如果库没有发布到 Maven 仓库)
3. 使用 GitHub 仓库(如果库发布在 GitHub)
4. 使用 AndroidX 或 Support 库
5. 配置 ProGuard 或 R8(如果需要)
总结
Last updated