From 912c380a8a7ea467c19030e0b7b4e54c773cdc1a Mon Sep 17 00:00:00 2001 From: km2025 Date: Mon, 19 Jan 2026 15:10:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20VideoBox=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=B8=AD=E5=AF=B9=20imageRef=20=E7=9A=84?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=EF=BC=8C=E9=81=BF=E5=85=8D=E6=BD=9C=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=E7=A9=BA=E5=BC=95=E7=94=A8=E9=94=99=E8=AF=AF=EF=BC=9B?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9E=84=E5=BB=BA=E9=85=8D=E7=BD=AE=E4=BB=A5?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E7=A6=81=E7=94=A8=20Proguard=20=E5=92=8C?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=BC=A9=E5=87=8F=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=86=85=E5=AD=98=E5=8D=A0=E7=94=A8=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9C=AC=E5=9C=B0=E6=9E=84=E5=BB=BA=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- @share/components/Video.tsx | 2 +- app.config.js | 8 +++++--- package.json | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/@share/components/Video.tsx b/@share/components/Video.tsx index 4c51520..68f0bbb 100644 --- a/@share/components/Video.tsx +++ b/@share/components/Video.tsx @@ -79,7 +79,7 @@ const VideoBox = ({ url, needWeb = true, width = 256, style, autoplay = true, .. // 控制动画播放/停止 useEffect(() => { - if (imageRef.current) { + if (imageRef?.current) { if (autoplay) { imageRef.current?.startAnimating() } else { diff --git a/app.config.js b/app.config.js index d74bf76..07a3434 100644 --- a/app.config.js +++ b/app.config.js @@ -117,14 +117,16 @@ export default ({ config }) => { useFrameworks: 'static', }, android: { - enableProguardInReleaseBuilds: true, - enableShrinkResourcesInReleaseBuilds: true, + // 解决构建打包时webp导致内存占用过高,临时禁用 + enableProguardInReleaseBuilds: false, + enableShrinkResourcesInReleaseBuilds: false, + // 增加 Java 堆内存 packagingOptions: { pickFirst: ['**/libc++_shared.so', '**/libjsc.so'], }, // 设置 JVM 参数 - jvmArgs: ['-Xmx4096m', '-XX:MaxMetaspaceSize=512m'], + jvmArgs: ['-Xmx4096m', '-XX:MaxMetaspaceSize=1024m'], extraProguardRules: `-keep class com.tencent.mm.opensdk.** { *; } diff --git a/package.json b/package.json index 10649bf..08d64b0 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,9 @@ "build:production:android": "eas build --profile production --platform android", "update:test": "dotenv -e .env.test -- eas update --clear-cache --channel test", "update:production": "dotenv -e .env.production -- eas update --clear-cache --channel production", + "build:local:development:android": "dotenv -e .env.development -- eas build --profile development --platform android --local", + "build:local:test:android": "dotenv -e .env.test -- eas build --profile test --platform android --local", + "build:local:production:android": "dotenv -e .env.production -- eas build --profile production --platform android --local", "build:local": "eas build --profile production --local", "check-types": "tsc --noEmit", "lint": "expo lint",