136 lines
4.1 KiB
Groovy
136 lines
4.1 KiB
Groovy
apply plugin: 'com.android.application'
|
||
|
||
/*
|
||
修订说明:
|
||
- 增加 repositories(包含 google/mavenCentral + flatDir 指向 libs)
|
||
- 合并 fileTree 引入(同时包含 .jar 和 .aar)
|
||
- 保留 uniapp 必需配置和 packagingOptions
|
||
- 请确保 app/libs 下只有一份 share-weixin-release.aar,且没有重复同名 AAR
|
||
*/
|
||
|
||
repositories {
|
||
google()
|
||
mavenCentral()
|
||
// 把 app/libs 当作本地仓库(部分环境需要)
|
||
flatDir {
|
||
dirs 'libs'
|
||
}
|
||
}
|
||
|
||
android {
|
||
compileSdk 35
|
||
|
||
namespace 'com.android.hldy'
|
||
|
||
defaultConfig {
|
||
applicationId "com.android.hldy"
|
||
minSdkVersion 21
|
||
targetSdkVersion 33
|
||
versionCode 10010
|
||
versionName "1.0.010"
|
||
multiDexEnabled true
|
||
|
||
ndk {
|
||
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
}
|
||
|
||
signingConfigs {
|
||
config {
|
||
keyAlias 'key0'
|
||
keyPassword '123456'
|
||
storeFile file('uniplugin.jks')
|
||
storePassword '123456'
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
release {
|
||
signingConfig signingConfigs.config
|
||
zipAlignEnabled false
|
||
minifyEnabled false
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
}
|
||
debug {
|
||
signingConfig signingConfigs.config
|
||
zipAlignEnabled false
|
||
minifyEnabled false
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
}
|
||
}
|
||
|
||
/* uniapp 必需配置 */
|
||
aaptOptions {
|
||
additionalParameters '--auto-add-overlay'
|
||
ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
|
||
}
|
||
|
||
lint {
|
||
baseline = file("lint-baseline.xml")
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
|
||
packagingOptions {
|
||
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
||
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
||
pickFirst 'lib/x86/libc++_shared.so'
|
||
jniLibs {
|
||
useLegacyPackaging true
|
||
}
|
||
}
|
||
|
||
sourceSets {
|
||
main {
|
||
jniLibs.srcDirs = ['libs']
|
||
}
|
||
}
|
||
}
|
||
|
||
dependencies {
|
||
// 一行同时包含 .jar 和 .aar,避免重复引用问题
|
||
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
|
||
|
||
/* uniapp 所需基础库 */
|
||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||
implementation 'com.facebook.fresco:fresco:1.13.0'
|
||
implementation "com.facebook.fresco:animated-gif:1.13.0"
|
||
implementation 'com.github.bumptech.glide:glide:4.9.0'
|
||
implementation 'com.alibaba:fastjson:1.2.83'
|
||
implementation 'androidx.webkit:webkit:1.3.0'
|
||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
|
||
implementation 'androidx.core:core:1.1.0'
|
||
implementation "androidx.fragment:fragment:1.1.0"
|
||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||
implementation 'com.google.android.material:material:1.5.0'
|
||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||
|
||
/* Kotlin & 协程 */
|
||
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.0"
|
||
implementation "org.jetbrains.kotlin:kotlin-reflect:1.6.0"
|
||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8"
|
||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8"
|
||
|
||
/* 网络 & 权限库 */
|
||
implementation "com.squareup.okhttp3:okhttp:3.12.12"
|
||
implementation "com.github.getActivity:XXPermissions:18.0"
|
||
|
||
/* 项目模块 */
|
||
implementation project(':mylibrary')
|
||
|
||
/* 微信 SDK(无 MTA 版本) - 通过 Maven 引入 */
|
||
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.8.0'
|
||
|
||
// 注意:不要在这里再写 implementation(name:'share-weixin-release', ext:'aar'),fileTree 已经包含 .aar
|
||
}
|