@@ -19,7 +19,8 @@ the MyID SDK will **crash during initialization**.
*[3. Pass Huawei App ID to the SDK](#3-pass-huawei-app-id-to-the-sdk)
*[4. Example setup](#4-example-setup)
*[5. Enable Safety Detect in AppGallery Connect](#5-enable-safety-detect-in-appgallery-connect)
*[6. Troubleshooting](#6-troubleshooting)
*[6. ProGuard rules](#6-proguard-rules)
*[7. Troubleshooting](#7-troubleshooting)
---
...
...
@@ -116,7 +117,21 @@ To successfully publish the application in the Huawei AppGallery console, it is
---
## 6. Troubleshooting
## 6. ProGuard rules
If you use **R8/ProGuard** (`minifyEnabled true`), add the following rules to your `proguard-rules.pro` file to keep the Huawei HMS classes from being removed or obfuscated:
```proguard
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
```
Without these rules, HMS components may be stripped during minification, causing crashes or initialization failures in release builds on Huawei devices.