【问题标题】:How to resolve libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 19062 (GLThread 249), pid 15351如何解决 libc:致命信号 11 (SIGSEGV)、代码 1 (SEGV_MAPERR)、tid 19062 (GLThread 249) 中的故障地址 0x0、pid 15351
【发布时间】:2022-03-29 16:03:23
【问题描述】:

我在尝试使用 dexguard 在发布模式下打开 HMS 地图时遇到了这个问题。应用程序崩溃并出现此异常:

libc:致命信号 11 (SIGSEGV),代码 1 (SEGV_MAPERR),tid 19062 (GLThread 249) 中的故障地址 0x0,pid 15351 (nza.ambitwizhmb) 2022-01-25 23:44:02.463 19184-19184/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** * ** 2022-01-25 23:44:02.463 19184-19184/? A/DEBUG:构建指纹:'HUAWEI/JNY-LX1/HWJNY:10/HUAWEIJNY-L21/10.1.0.386C185:user/release-keys' 2022-01-25 23:44:02.463 19184-19184/? A/调试:uid:10196 2022-01-25 23:44:02.463 19184-19184/? A/DEBUG:信号11(SIGSEGV),代码1(SEGV_MAPERR),故障地址0x0

当我在调试模式下运行该应用程序时,它运行得非常好。打开地图时,崩溃时间会有所不同。有时地图显示正确,但有时在加载时崩溃。

hms 的 dexguard 配置是

-keep class com.huawei.agconnect.**{*;}
-dontwarn com.huawei.agconnect.**
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
-keep interface com.huawei.hms.analytics.type.HAEventType{*;}
-keep interface com.huawei.hms.analytics.type.HAParamType{*;}
-keep class com.huawei.agconnect.** {*;}
-keepresources string/agc_*
-keepresources string/upsdk_store_url
-keepresources string/hms_update_title
-keepresourcefiles assets/hmsrootcas.bks
-keepresourcefiles assets/grs_*

【问题讨论】:

  • hi@Taha alam,我可以确认您使用的地图 SDK 版本是什么吗?建议您使用lastest version

标签: android huawei-mobile-services dexguard huawei-map-kit


【解决方案1】:

建议您参考this docs配置混淆。

  1. 打开项目应用根目录下的混淆配置文件proguard-rules.pro,添加配置排除HMS Core SDK混淆。
-ignorewarnings 
-keepattributes *Annotation* 
-keepattributes Exceptions 
-keepattributes InnerClasses 
-keepattributes Signature 
-keepattributes SourceFile,LineNumberTable 
-keep class com.huawei.hianalytics.**{*;} 
-keep class com.huawei.updatesdk.**{*;} 
-keep class com.huawei.hms.**{*;}
  1. 如果您使用的是 AndResGuard,请将其信任列表添加到项目的应用级 build.gradle 文件中。
"R.string.agc*",
"R.string.hms*", 
"R.string.connect_server_fail_prompt_toast", 
"R.string.getting_message_fail_prompt_toast", 
"R.string.no_available_network_prompt_toast", 
"R.string.third_app_*", 
"R.string.upsdk_*", 
"R.layout.hms*", 
"R.layout.upsdk_*", 
"R.drawable.upsdk*", 
"R.color.upsdk*", 
"R.dimen.upsdk*", 
"R.style.upsdk*"
  1. (可选)如下配置keep.xml文件以保留布局资源,如果您启用了R8资源收缩(在项目级build.gradle文件中将shrinkResources设置为true)和严格的参考检查(shrinkModeres/raw/keep.xml 文件中设置为strict)。不保留布局资源将导致应用在发布到华为应用市场时被拒绝。
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
    tools:keep="@layout/hms_download_progress,@drawable/screen_off,@layout/upsdk*"
    tools:shrinkMode="strict" />

【讨论】:

    【解决方案2】:

    我不确定你和我是否在同一页面上,但我遇到了类似的问题

    致命信号 11 (SIGSEGV),代码 1 (SEGV_MAPERR),tid 5700 (RenderThread) 中的故障地址 0x20,pid 5609 (com.xxpackagenamexx)

    然后当它发生时我绕过我的代码/屏幕,即 React-native 代码

    <WebView
            onLoadStart={() => setLoading(true)}
            onLoadEnd={() => setLoading(false)}
            onLoadProgress={() => setLoading(true)}  //This particular line was generating issue
            originWhitelist={['*']}
            injectedJavaScript="window.ReactNativeWebView.postMessage(document.body.scrollHeight)"
            source={{uri: 'http://example.com/pd-terms-of-use.html'}}></WebView>
    

    我所做的一切都被删除了 onLoadProgress 并且我还认为在调用 onLoadEnd 之前按下执行 navigation.goBack(null) 的返回按钮时发生了同样的问题,然后它遇到了致命的信号问题......所以

    我所做的只是

    onPress={() => {
              if (loading == false) {
                navigation.goBack(null);
              }
            }}
    

    只是试图避免/忽略生成代码的问题... 希望它有所帮助:-p

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-01
      • 2022-11-21
      • 2021-09-10
      • 1970-01-01
      • 1970-01-01
      • 2016-05-17
      • 1970-01-01
      • 2020-07-19
      相关资源
      最近更新 更多