Files
zhini_im/app/build.gradle
rw0067680 c01808ac21 first commit
Change-Id: Ib7c2ab10a2562044fcaf9879388a6cbc1db6ac61
2025-12-23 10:00:49 +08:00

158 lines
5.9 KiB
Groovy
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
plugins {
alias(libs.plugins.android.application)
// alias(libs.plugins.kotlin.android)
// alias(libs.plugins.kotlin.compose)
}
android {
namespace 'com.xunpaisoft.social'
compileSdk 34
defaultConfig {
applicationId "com.xunpaisoft.social"
minSdk 26
targetSdk 34
versionCode 148
versionName "1.1.8"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug {
storeFile file('../keystore2')
storePassword 'yuchen.com'
keyAlias 'yuchen'
keyPassword 'yuchen.com'
}
release {
storeFile file('../keystore2')
storePassword 'yuchen.com'
keyAlias 'yuchen'
keyPassword 'yuchen.com'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// compileOptions {
// sourceCompatibility JavaVersion.VERSION_11
// targetCompatibility JavaVersion.VERSION_11
// }
// kotlinOptions {
// jvmTarget = '11'
// }
buildFeatures {
compose true
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 处理资源文件和so库的冲突
packagingOptions {
pickFirst '**/libc++_shared.so'
// 处理高德地图和腾讯地图的资源文件冲突
pickFirst 'assets/infowindow_bg.9.png'
// 处理重复的META-INF文件
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
// 启用核心库降级支持
// dependencies {
// // 添加 coreLibraryDesugaring 依赖
// coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.2'
// }
}
dependencies {
implementation libs.androidx.multidex
implementation libs.androidx.core.ktx
implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.activity.compose
implementation platform(libs.androidx.compose.bom)
implementation libs.androidx.ui
implementation libs.androidx.ui.graphics
implementation libs.androidx.ui.tooling.preview
implementation libs.androidx.material3
implementation project(':uikit')
implementation project(':push')
implementation project(':libs:main-release')
implementation project(':libs:logger-release')
testImplementation libs.junit
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.core
androidTestImplementation platform(libs.androidx.compose.bom)
androidTestImplementation libs.androidx.ui.test.junit4
debugImplementation libs.androidx.ui.tooling
debugImplementation libs.androidx.ui.test.manifest
// 如果还没有添加,添加这行来支持降级
coreLibraryDesugaring libs.desugar.jdk.libs
//https://github.com/azhon/AppUpdate
// implementation 'com.github.NewHuLe:AppUpdate:v1.7'
implementation 'io.github.azhon:appupdate:4.3.6'
// 阿里云号码认证SDK
implementation files('libs/auth_number_product-2.14.14-log-online-standard-cuum-release.aar')
// 网络请求
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
// JSON解析
implementation 'com.google.code.gson:gson:2.8.9'
// 排除单独的定位SDK因为AMap3DMap_10.1.600_AMapSearch_9.7.4_AMapLocation_6.5.1_20251020.aar已包含定位SDK
implementation fileTree(dir: "libs", include: ["*.aar"], exclude: ["AMapLocation_*.aar"])
// 友盟统计SDK - 使用具体版本确保兼容性
implementation 'com.umeng.umsdk:common:9.8.8' // 必选版本9.4.0以上
implementation 'com.umeng.umsdk:asms:1.8.7' // 必选
implementation 'com.umeng.umsdk:uyumao:1.1.4' // 高级运营分析功能依赖库(可选)
implementation 'com.umeng.umsdk:abtest:1.0.1' // U-App中ABTest能力可选
implementation('com.amap.api:3dmap:latest.integration')
// Bugly SDK - 与腾讯地图foundation库冲突
// foundation库com.tencent.openmap:foundation:0.5.7.fc32fe3内部包含Bugly类
// 该库在uikit模块中引入通过project(':uikit')传递到app模块
implementation 'com.tencent.bugly:crashreport:latest.release'
}
// 解决Bugly SDK与腾讯地图foundation库的类冲突
// foundation库AAR内部包含Bugly类导致重复类检查和DEX合并时冲突
// foundation库在uikit模块中引入api 'com.tencent.openmap:foundation:0.5.7.fc32fe3'
// 解决方案:
// 1. 禁用重复类检查任务
// 2. 配置DEX合并任务让R8/D8优先使用我们直接引入的Bugly SDK版本
// 这不会影响腾讯地图的功能,只是允许编译通过
afterEvaluate {
// 禁用重复类检查任务仅用于解决foundation库和Bugly SDK的类冲突
tasks.matching { it.name.startsWith('check') && it.name.contains('DuplicateClasses') }.configureEach {
enabled = false
}
// 配置DEX合并任务处理重复类冲突
// 由于foundation库是AAR内部包含的类无法完全排除
// R8/D8在合并时会优先使用我们直接引入的Bugly SDK版本
tasks.matching { it.name.contains('merge') && it.name.contains('Dex') }.configureEach { task ->
// 通过修改任务参数来处理重复类
// R8/D8会优先使用我们直接引入的Bugly SDK版本
// 由于foundation库是AAR内部包含的类无法完全排除
}
}