uni-app 安卓离线打包播放视频闪退

uni-app 安卓离线打包播放视频闪退

开发环境 版本号 项目创建方式
Mac 11.3.1 HBuilderX

产品分类:uniapp/App
PC开发环境操作系统:Mac
HBuilderX类型:正式
HBuilderX版本号:3.1.21
手机系统:Android
手机系统版本号:Android 11
手机厂商:小米
手机机型:11
页面类型:nvue
打包方式:离线

bug描述:

使用 `<video>` 视频播放闪退,使用离线打包

小米11闪退,但是老机型和虚拟机则不会闪退

ndk {
abiFilters 'x86', 'armeabi-v7a'
}

删除arm64-v8a 运行正常,怀疑是arm64-v8a 支持库有问题

报错日志

W/View: requestLayout() improperly called by android.widget.RelativeLayout{6c93bff V.E...... ......ID 0,137-1440,291} during layout: running second layout pass
requestLayout() improperly called by android.widget.RelativeLayout{a306dcc V.E...... ......ID 720,37-720,116} during layout: running second layout pass
...

更多关于uni-app 安卓离线打包播放视频闪退的实战教程也可以访问 https://www.itying.com/category-93-b0.html

5 回复

我也遇到这个问题了,用最新的sdk离线打包,视频无法播放

更多关于uni-app 安卓离线打包播放视频闪退的实战教程也可以访问 https://www.itying.com/category-93-b0.html


确认下来就是这个问题 删除arm64-v8a 运行正常,怀疑是arm64-v8a 支持库有问题

升级到最新的HBuilder X试一下,然后说明一下具体的手机型号,离线打包还是云打包

回复 DCloud_Android_zl: 3063 (ff_read), pid 2243 (io.dcloud.unimp) 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: Softversion: PD2046_A_5.16.1 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: Time: 2023-01-03 14:17:41 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG:
2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: Build fingerprint: ‘vivo/PD2046/PD2046:11/RP1A.200720.012/compiler10211526:user/release-keys’ 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: Revision: ‘0’ 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: ABI: ‘arm64’ 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: Timestamp: 2023-01-03 14:17:41+0800 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: pid: 2243, tid: 3063, name: ff_read >>> com.ouyeel.mobilePro:io.dcloud.unimp <<< 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: uid: 11089 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x74737b2c227765 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x0 b4000076eefb1000 x1 0000000000000001 x2 000000778f877920 x3 0000000000001020 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x4 6174737b2c227765 x5 8000000000800080 x6 ff63070279ff71ff x7 7f7f7f7f7f7f7f7f 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x8 0101010101010101 x9 3119ad3389c2d301 x10 00000076ef00dd40 x11 b4000076ebb21628 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x12 0000000000000005 x13 0000000000000000 x14 fffffffffc000000 x15 0000000000000030 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x16 00000077911092c8 x17 0000007823c1f770 x18 00000076d7dd0000 x19 000000778f877920 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x20 b4000076eefb1000 x21 b4000076ebd16fa0 x22 b4000076ebd16f40 x23 000000778f878a88 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x24 0000000000000000 x25 0000007790b51000 x26 0000000000000001 x27 b4000076e85ff548 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: x28 00000000000fc000 x29 000000778f878c70 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: lr 0000007790ea5aa4 sp 000000778f8778e0 pc 0074737b2c227765 pst 0000000000001000 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: backtrace: 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: #00 pc 0074737b2c227765 <unknown> 2023-01-03 14:17:41.659 3076-3076/? A/DEBUG: #01 pc 0000000000312aa0 /data/app/~~1A1dvTTW3iK5JDS-tPrzUQ==/com.ouyeel.mobilePro-OEiPB6WK_B07XzUwlLIaag==/lib/arm64/libijkffmpeg.so (av_application_on_http_event+24)

这是一个典型的架构兼容性问题。从日志和现象来看,问题确实出在arm64-v8a架构支持上。

小米11使用的是64位ARM处理器,默认会加载arm64-v8a目录下的so库。当删除arm64-v8a目录后,系统会回退到armeabi-v7a的兼容模式运行,这就是为什么删除后能正常运行的原因。

解决方案:

  1. 检查so库完整性:确保所有必要的so库在arm64-v8a目录下都存在且版本匹配。特别是视频编解码相关的库文件。

  2. 更新NDK配置:在app的build.gradle中,建议保留arm64-v8a支持:

ndk {
    abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86'
}
回到顶部