fix: 修复 VideoBox 组件中对 imageRef 的访问,避免潜在的空引用错误;更新构建配置以临时禁用 Proguard 和资源缩减,解决内存占用问题;添加本地构建脚本
This commit is contained in:
parent
f557fb74b3
commit
912c380a8a
|
|
@ -79,7 +79,7 @@ const VideoBox = ({ url, needWeb = true, width = 256, style, autoplay = true, ..
|
||||||
|
|
||||||
// 控制动画播放/停止
|
// 控制动画播放/停止
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (imageRef.current) {
|
if (imageRef?.current) {
|
||||||
if (autoplay) {
|
if (autoplay) {
|
||||||
imageRef.current?.startAnimating()
|
imageRef.current?.startAnimating()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -117,14 +117,16 @@ export default ({ config }) => {
|
||||||
useFrameworks: 'static',
|
useFrameworks: 'static',
|
||||||
},
|
},
|
||||||
android: {
|
android: {
|
||||||
enableProguardInReleaseBuilds: true,
|
// 解决构建打包时webp导致内存占用过高,临时禁用
|
||||||
enableShrinkResourcesInReleaseBuilds: true,
|
enableProguardInReleaseBuilds: false,
|
||||||
|
enableShrinkResourcesInReleaseBuilds: false,
|
||||||
|
|
||||||
// 增加 Java 堆内存
|
// 增加 Java 堆内存
|
||||||
packagingOptions: {
|
packagingOptions: {
|
||||||
pickFirst: ['**/libc++_shared.so', '**/libjsc.so'],
|
pickFirst: ['**/libc++_shared.so', '**/libjsc.so'],
|
||||||
},
|
},
|
||||||
// 设置 JVM 参数
|
// 设置 JVM 参数
|
||||||
jvmArgs: ['-Xmx4096m', '-XX:MaxMetaspaceSize=512m'],
|
jvmArgs: ['-Xmx4096m', '-XX:MaxMetaspaceSize=1024m'],
|
||||||
extraProguardRules: `-keep class com.tencent.mm.opensdk.** {
|
extraProguardRules: `-keep class com.tencent.mm.opensdk.** {
|
||||||
*;
|
*;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@
|
||||||
"build:production:android": "eas build --profile production --platform android",
|
"build:production:android": "eas build --profile production --platform android",
|
||||||
"update:test": "dotenv -e .env.test -- eas update --clear-cache --channel test",
|
"update:test": "dotenv -e .env.test -- eas update --clear-cache --channel test",
|
||||||
"update:production": "dotenv -e .env.production -- eas update --clear-cache --channel production",
|
"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",
|
"build:local": "eas build --profile production --local",
|
||||||
"check-types": "tsc --noEmit",
|
"check-types": "tsc --noEmit",
|
||||||
"lint": "expo lint",
|
"lint": "expo lint",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue