1、Google APP Bundle打包配置

2、打包时忽略掉声网的SO文件
This commit is contained in:
laopi 2024-09-02 13:09:27 +08:00
parent e79741b297
commit ca13774d87
2 changed files with 26 additions and 7 deletions

View File

@ -74,7 +74,10 @@ android {
exclude 'lib/armeabi-v7a/libfuai.so' exclude 'lib/armeabi-v7a/libfuai.so'
exclude 'lib/arm64-v8a/libfuai.so' exclude 'lib/arm64-v8a/libfuai.so'
} }
exclude 'lib/armeabi-v7a/libagora-*.so'
exclude 'lib/arm64-v8a/libagora-*.so'
exclude 'lib/x86/libagora-*.so'
exclude 'lib/x86_64/libagora-*.so'
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_17 sourceCompatibility JavaVersion.VERSION_17
@ -83,7 +86,22 @@ android {
buildFeatures { buildFeatures {
buildConfig = true buildConfig = true
} }
// Google APP Bundle打包配置
bundle {
density {
// Different APKs are generated for devices with different screen densities; true by default.
enableSplit rootProject.ext.manifestPlaceholders.isAppBundle
}
abi {
// Different APKs are generated for devices with different CPU architectures; true by default.
enableSplit rootProject.ext.manifestPlaceholders.isAppBundle
}
language {
// This is disabled so that the App Bundle does NOT split the APK for each language.
// We're gonna use the same APK for all languages.
enableSplit rootProject.ext.manifestPlaceholders.isAppBundle
}
}
applicationVariants.all { variant -> applicationVariants.all { variant ->
println "清空build文件夹"; println "清空build文件夹";
@ -255,12 +273,12 @@ android {
println("处理ndk 版本 = " + tskReqStr) println("处理ndk 版本 = " + tskReqStr)
def isLink = tskReqStr.contains("Link") def isLink = tskReqStr.contains("Link")
if (isLink) {//32so库可以有效降低包体大小 if (isLink) {//32so库可以有效降低包体大小
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" // abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
//abiFilters "arm64-v8a", "x86_64" abiFilters "arm64-v8a", "x86_64"
println("打包ndk 链接") println("打包ndk 链接")
} else { } else {
abiFilters "armeabi-v7a", "arm64-v8a" // abiFilters "armeabi-v7a", "arm64-v8a"
//abiFilters "arm64-v8a" abiFilters "arm64-v8a"
println("打包ndk其他") println("打包ndk其他")
} }
} }

View File

@ -32,6 +32,7 @@ ext {
isPluginModel : false, isPluginModel : false,
facebook_app_id : "2011402032399020", facebook_app_id : "2011402032399020",
facebook_client_token : "959584e054a33614996361f0044e5253", facebook_client_token : "959584e054a33614996361f0044e5253",
lineChannelId : "1656399535" lineChannelId : "1656399535",
isAppBundle: true
] ]
} }