介绍
- 本文基于上述doc进行一次体验记录
- 当前时间2018年4月11曰,版本号4.7
建测试项目以及引入
坑:
Failed to resolve: com.github.bumptech.glide:glide:4.7.0
Show in File
Show in Project Structure dialog
查询文档:
Android SDK 要求:
Min Sdk Version - 使用 Glide 需要 min SDK 版本 API 14 (Ice Cream Sandwich) 或更高。
Compile Sdk Version - Glide 必须使用 API 27 (Oreo MR1) 或更高版本的 SDK 来编译。
Support Library Version - Glide 使用的支持库版本为 27。
如果你需要使用不同的支持库版本
你需要在你的 build.gradle 文件里去从 Glide 的依赖中去除 “com.android.support”。例如,假如你想使用 v26 的支持库:
dependencies {
implementation ("com.github.bumptech.glide:glide:4.6.1") {
exclude group: "com.android.support"
}
implementation "com.android.support:support-fragment:26.1.0"
}
使用与 Glide 依赖的支持库不同的版本可能会导致一些运行时异常 ,例如:
java.lang.NoSuchMethodError: No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)Landroid/graphics