HMS Dexguard 混淆问题

问题描述 投票:0回答:2

我已经在我的应用程序中实现了 dexguard。当没有进行混淆时应用程序可以工作,但是当 dexguard 混淆完成时应用程序会崩溃。

它给出了错误。

由以下原因引起:android.view.InflateException:com.avanza.ambitwizhmb 中的二进制 XML 文件第 0 行:layout/2131558492:膨胀类片段时出错

Caused by: com.huawei.hms.maps.model.RuntimeRemoteException: AppId is null. Please check whether the agconnect-services.json file is added to your app project.

华为的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{*;}
android crash huawei-mobile-services dexguard
2个回答
0
投票
After obfuscation hms map not able to get appid from agconnect json, best way to fix this issue, add the appid in android manifest also like this 
" <meta-data
            android:name="com.huawei.hms.client.appid"
            android:value="appid=xxxxxx" />"

-1
投票

如果应用打包时使用Dexguard混淆,则需要配置以下内容:

-ignorewarnings
-keep class com.huawei.agconnect.** {*;}
-keepresourcexmlelements **
-keepresources /
© www.soinside.com 2019 - 2024. All rights reserved.