致命信号 11 (SIGSEGV),代码 1 (SEGV_MAPERR),tid 22274 (hwuiTask1) 中的故障地址 0x0

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) , fault addr 0x0 in tid 22274 (hwuiTask1)

当我使用 exoplayer 播放视频并收到此错误“致命信号 11 (SIGSEGV),代码 1 (SEGV_MAPERR),错误地址 0x0 in tid 22274 (hwuiTask1)”时,应用程序崩溃。当我正在使用 android:hardwareAccelerated="false" 然后它只能工作,但在我的情况下 false 会产生显示内容的问题。所以我所做的是,我将 layertype 实现为仅用于视频查看但不显示视频的软件。我检查了很多解决方案,比如 Android Fatal signal 11 (SIGSEGV) at 0x636f7d89 (code=1). How can it be tracked down? 但仍然没有解决问题,谁能帮我解决这个问题。这是我的堆栈跟踪 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: Cause: null pointer dereference 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x0 00000073d1a1f448 x1 0000007433421820 x2 0000000000000020 x3 0000000000000002 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x4 00000073d03c65a0 x5 00000073d03c65c0 x6 000000743708e940 x7 000000743708e760 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x8 00000073d1a1f3c0 x9 0000000000000088 x10 000000000000000f x11 00000073c0000000 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x12 0000000000000020 x13 0000000000011bb8 x14 0000000000000001 x15 0000000000000000 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x16 00000074c54ee890 x17 00000074c6a6b640 x18 00000073b76de000 x19 0000000000000000 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x20 0000007433421820 x21 00000073d1a1f448 x22 00000074c54e9b28 x23 0000007432b9c020 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x24 00000074c54e9b78 x25 0000000000000000 x26 0000000000000001 x27 0000000000000003 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: x28 0000000000000000 x29 0000007432b99e20 2021-09-02 18:45:35.646 22280-22280/? A/DEBUG: sp 0000007432b99e00 lr 00000074c54b10c0 pc 00000074c6a6b65c 2021-09-02 18:45:35.932 22280-22280/? A/DEBUG: backtrace: 2021-09-02 18:45:35.932 22280-22280/? A/DEBUG: #00 pc 000000000000f65c /system/lib64/libutils.so (android::RefBase::decStrong(void const*) const+28) (BuildId: e694ec4393425b1d99ea7621766c5862) 2021-09-02 18:45:35.932 22280-22280/? A/DEBUG: #01 pc 00000000000a70bc /system/lib64/libgui.so (android::Vector<android::ComposerState>::do_destroy(void*, unsigned long) const+32) (BuildId: 7a4120ceec9f946dbd431c5623be1c15) 2021-09-02 18:45:35.933 22280-22280/? A/DEBUG: #02 pc 000000000001610c /system/lib64/libutils.so (android::VectorImpl::finish_vector()+80) (BuildId: e694ec4393425b1d99ea7621766c5862)

我解决了这个问题,可能会对其他人有所帮助。当我使用表面视图为某些设备(如 moto e(7) plus、One Plus 6)播放带有 android:hardwareAccelerated="true" 的视频时,问题出在 exoplayer 上。所以,我在 exoplayer 布局文件中添加了 app:surface_type="texture_view" 这样的

<com.google.android.exoplayer2.ui.PlayerView
     android:id="@+id/video_player"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="0dp"
     android:background="@color/black"
     android:padding="0dp"
     app:surface_type="texture_view"
     app:resize_mode="fixed_height">

</com.google.android.exoplayer2.ui.PlayerView>