androidx.startup.InitializationProvider 在 Application 启动时被加载, 但被分配到 secondary dex 导致 Dalvik VM 找不到该类。 通过 multiDexKeepProguard 强制保留在 main dex 中。
106 lines
3.2 KiB
Groovy
106 lines
3.2 KiB
Groovy
plugins {
|
||
id 'com.android.application'
|
||
id 'org.jetbrains.kotlin.android'
|
||
}
|
||
|
||
android {
|
||
namespace 'com.pukka.mediaapp'
|
||
compileSdk 34
|
||
|
||
defaultConfig {
|
||
applicationId "com.pukka.mediaapp.partnertest"
|
||
minSdk 17
|
||
targetSdk 29
|
||
versionCode 1
|
||
versionName "1.0"
|
||
multiDexEnabled true
|
||
multiDexKeepProguard file('multidex-config.pro')
|
||
|
||
ndk {
|
||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
release {
|
||
minifyEnabled false
|
||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
}
|
||
}
|
||
|
||
buildFeatures {
|
||
viewBinding true
|
||
buildConfig true
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_17
|
||
targetCompatibility JavaVersion.VERSION_17
|
||
}
|
||
|
||
kotlinOptions {
|
||
jvmTarget = '17'
|
||
}
|
||
|
||
sourceSets {
|
||
main {
|
||
jniLibs.srcDirs = ['libs']
|
||
}
|
||
}
|
||
|
||
packagingOptions {
|
||
jniLibs {
|
||
useLegacyPackaging = true
|
||
}
|
||
resources {
|
||
excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/license.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/notice.txt', 'META-INF/ASL2.0', 'META-INF/*.kotlin_module']
|
||
}
|
||
}
|
||
}
|
||
|
||
dependencies {
|
||
// Kotlin & AndroidX
|
||
implementation 'androidx.core:core-ktx:1.12.0'
|
||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||
implementation 'com.google.android.material:material:1.11.0'
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
|
||
implementation 'androidx.activity:activity-ktx:1.3.1'
|
||
|
||
// 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'
|
||
|
||
// Gson
|
||
implementation 'com.google.code.gson:gson:2.10.1'
|
||
|
||
// Coroutines
|
||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
||
|
||
// 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'
|
||
|
||
// commons-codec(SDK 依赖)
|
||
implementation 'commons-codec:commons-codec:1.15'
|
||
|
||
// 火山引擎 TLS 日志库(JetsenxSdk 内部依赖)
|
||
implementation('io.github.volcengine-tls:tls-android-producer:2.0.2-api16') {
|
||
exclude group: 'com.google.guava', module: 'guava'
|
||
exclude group: 'com.google.guava', module: 'guava-jdk5'
|
||
exclude group: 'com.google.guava', module: 'guava-android'
|
||
exclude group: 'com.google.guava', module: 'listenablefuture'
|
||
}
|
||
implementation 'net.jpountz.lz4:lz4:1.3.0'
|
||
implementation 'org.slf4j:slf4j-android:1.7.36'
|
||
}
|