尝试使用 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/DEBUG: 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_*