0

I am having this issue when trying to open the HMS Map on release mode with dexguard. the app crashes and gives this exception:

libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 19062 (GLThread 249), 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: Build fingerprint: 'HUAWEI/JNY-LX1/HWJNY:10/HUAWEIJNY-L21/10.1.0.386C185:user/release-keys' 2022-01-25 23:44:02.463 19184-19184/? A/DEBUG: uid: 10196 2022-01-25 23:44:02.463 19184-19184/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0

The app works absolutely fine when I run it on debug mode. The crash timming differs when the map is opened. sometimes the map is displayed correctly but sometimes it crashes when it was loading.

dexguard configuration for hms is

-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_*
Taha alam
  • 372
  • 3
  • 11
  • hi@Taha alam, may i confirm what was the version of the map SDK that you are using? you are advised to use the [lastest version](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-sdk-version-change-history-0000001050156688?ha_source=hms1). – zhangxaochen Jan 26 '22 at 01:20

2 Answers2

1

I am not sure if you and I are on the same page but I got a similar issue

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20 in tid 5700 (RenderThread), pid 5609 (com.xxpackagenamexx)

Then I went around my code/screen when it happenned i.e. React-native codes

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

All I did was removed onLoadProgress and I also figured same issue was occurred when I pressed back button that executes navigation.goBack(null) before onLoadEnd was called then it hits the Fatal signal issue... so

All I did was

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

Just trying to avoid/ignore issue generating codes... Hope it helps :-p

Rahul Shakya
  • 1,269
  • 15
  • 15
  • For me indeed it was an issue with the webview, but your solution did not work for me. Here's the solution I followed: https://stackoverflow.com/a/74577941/14056591 – Ovidiu Cristescu Nov 25 '22 at 21:32
0

It is recommended that you configure confusion by referring to this docs.

  1. Open the obfuscation configuration file proguard-rules.pro in the app's root directory of your project, and add configurations to exclude the HMS Core SDK from obfuscation.
-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. If you are using AndResGuard, add its trustlist to the app-level build.gradle file of your project.
"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. (Optional) Configure the keep.xml file as follows to keep layout resources if you have enabled R8 resource shrinking (with shrinkResources being set to true in the project-level build.gradle file) and strict reference checks (with shrinkMode being set to strict in the res/raw/keep.xml file). Not keeping layout resources will lead to app rejection during release to HUAWEI AppGallery.
<?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" />
zhangxaochen
  • 32,744
  • 15
  • 77
  • 108