plugins { id 'com.android.application' } android { namespace 'com.easyscreen.player' compileSdk 36 defaultConfig { applicationId "com.easyscreen.player" minSdk 23 // Android 6.0 targetSdk 36 versionCode 1 versionName "1.0.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } // 统一 Kotlin 标准库版本,解决 okhttp(4.x)/glide 传递依赖导致的重复类冲突 configurations.all { resolutionStrategy { force 'org.jetbrains.kotlin:kotlin-stdlib:1.8.22' force 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22' force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22' } } dependencies { // androidx 注解(@Nullable 等) implementation 'androidx.annotation:annotation:1.6.0' // 网络 implementation 'com.squareup.okhttp3:okhttp:4.11.0' // JSON implementation 'com.google.code.gson:gson:2.10.1' // 图片加载(本地缓存,断网仍可显示历史图片) implementation 'com.github.bumptech.glide:glide:4.15.1' // 视频播放(ExoPlayer 2.x,兼容 API 16+,老设备友好) implementation 'com.google.android.exoplayer:exoplayer-core:2.19.1' implementation 'com.google.android.exoplayer:exoplayer-ui:2.19.1' }