fix: Android 4.2 兼容性修复 - 降级第三方库 + 移除 ExoPlayer + multidex 配置
1. OkHttp 3.14.9 -> 3.12.0(Android10Platform 引用 Android 10+ API 导致 VerifyError) 2. Gson 2.10.1 -> 2.8.6(ReflectionHelper 引用 Java 9+ API 导致 VerifyError) 3. Retrofit 2.9.0 -> 2.6.0(与客户环境一致,配合 OkHttp 3.12.0) 4. Coroutines 1.7.3 -> 1.6.4(1.7+ 要求 minSdk 21) 5. 移除 ExoPlayer 2.19.1,改用系统原生 MediaPlayer + SurfaceView 6. 主题 MaterialComponents -> AppCompat(避免 MaterialComponentsViewInflater multidex 问题) 7. multidex-config.pro 新增 kotlinx.coroutines.** 和 retrofit2.** 到主 dex 8. 新增 Android 4.2 兼容性改动文档
This commit is contained in:
@@ -72,23 +72,25 @@ dependencies {
|
||||
// multidex
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
|
||||
// Retrofit + OkHttp(3.12.x 兼容 API 16+)
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.12'
|
||||
// Retrofit 2.6.0 + OkHttp 3.12.0(与客户环境一致,兼容 Android 4.x)
|
||||
// Retrofit 2.6.0 自然依赖 OkHttp 3.12.0(无 Android10Platform,不会 VerifyError)
|
||||
// OkHttp 3.12.1+ 包含 Android10Platform,引用 Android 10+ API,在 Android 4.x 上 VerifyError
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'
|
||||
|
||||
// Gson
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
// Gson 2.8.6(2.9+ 引入 ReflectionHelper,引用 Java 9+ API,在 Android 4.x 上 VerifyError)
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
|
||||
// Coroutines
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
||||
// Coroutines 1.6.4(1.7+ 要求 minSdk 21,1.6.4 兼容 API 16+)
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
|
||||
|
||||
// JetsenxSdk + NewTVSDK
|
||||
implementation files('libs/JetsenxSdk-api-future-release-v1.23.aar')
|
||||
implementation files('libs/NewTVSDK-v4.0.3-app-lite.jar')
|
||||
|
||||
// ExoPlayer
|
||||
implementation 'com.google.android.exoplayer:exoplayer:2.19.1'
|
||||
// 视频播放使用系统原生 MediaPlayer + SurfaceView,无需 ExoPlayer
|
||||
|
||||
// commons-codec(SDK 依赖)
|
||||
implementation 'commons-codec:commons-codec:1.15'
|
||||
@@ -103,3 +105,9 @@ dependencies {
|
||||
implementation 'net.jpountz.lz4:lz4:1.3.0'
|
||||
implementation 'org.slf4j:slf4j-android:1.7.36'
|
||||
}
|
||||
|
||||
// 强制 OkHttp 3.12.0(3.12.1+ 包含 Android10Platform,引用 Android 10+ API,在 Android 4.x 上 VerifyError)
|
||||
// 其他依赖传递引入 3.12.13,需 force 锁定 3.12.0
|
||||
configurations.all {
|
||||
resolutionStrategy.force 'com.squareup.okhttp3:okhttp:3.12.0'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user