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",