From ca13774d87934652ee9d0926436edcf482a21418 Mon Sep 17 00:00:00 2001 From: laopi <1198307949@qq.com> Date: Mon, 2 Sep 2024 13:09:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81Google=20APP=20Bundle=E6=89=93?= =?UTF-8?q?=E5=8C=85=E9=85=8D=E7=BD=AE=202=E3=80=81=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=97=B6=E5=BF=BD=E7=95=A5=E6=8E=89=E5=A3=B0=E7=BD=91=E7=9A=84?= =?UTF-8?q?SO=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 30 ++++++++++++++++++++++++------ config.gradle | 3 ++- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e91ca5efb..19521bbe2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -74,7 +74,10 @@ android { exclude 'lib/armeabi-v7a/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 { sourceCompatibility JavaVersion.VERSION_17 @@ -83,7 +86,22 @@ android { buildFeatures { 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 -> println "清空build文件夹"; @@ -255,12 +273,12 @@ android { println("处理ndk 版本 = " + tskReqStr) def isLink = tskReqStr.contains("Link") if (isLink) {//移除32位so库可以有效降低包体大小,等需要时再弄 - abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" - //abiFilters "arm64-v8a", "x86_64" +// abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + abiFilters "arm64-v8a", "x86_64" println("打包ndk 链接") } else { - abiFilters "armeabi-v7a", "arm64-v8a" - //abiFilters "arm64-v8a" +// abiFilters "armeabi-v7a", "arm64-v8a" + abiFilters "arm64-v8a" println("打包ndk其他") } } diff --git a/config.gradle b/config.gradle index beb9df9ca..2a6359cd9 100644 --- a/config.gradle +++ b/config.gradle @@ -32,6 +32,7 @@ ext { isPluginModel : false, facebook_app_id : "2011402032399020", facebook_client_token : "959584e054a33614996361f0044e5253", - lineChannelId : "1656399535" + lineChannelId : "1656399535", + isAppBundle: true ] }