Commit a473a513 authored by Javohir Savriy's avatar Javohir Savriy
Browse files

Update HUAWEI-CONFIGURATION.md

parent 0a2e55b5
...@@ -19,7 +19,8 @@ the MyID SDK will **crash during initialization**. ...@@ -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) * [3. Pass Huawei App ID to the SDK](#3-pass-huawei-app-id-to-the-sdk)
* [4. Example setup](#4-example-setup) * [4. Example setup](#4-example-setup)
* [5. Enable Safety Detect in AppGallery Connect](#5-enable-safety-detect-in-appgallery-connect) * [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 ...@@ -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.
---
## 7. Troubleshooting
| Issue | Cause | Solution | | Issue | Cause | Solution |
| -------------------------------------- | ------------------------------- | -------------------------------------------------------------------- | | -------------------------------------- | ------------------------------- | -------------------------------------------------------------------- |
...@@ -124,3 +139,4 @@ To successfully publish the application in the Huawei AppGallery console, it is ...@@ -124,3 +139,4 @@ To successfully publish the application in the Huawei AppGallery console, it is
| SDK fails to initialize | Missing App ID | Add `.withHuaweiAppId("YOUR_HUAWEI_APP_ID")` | | SDK fails to initialize | Missing App ID | Add `.withHuaweiAppId("YOUR_HUAWEI_APP_ID")` |
| Invalid App ID error | Wrong App ID in manifest or SDK | Recheck AppGallery Connect for correct ID | | Invalid App ID error | Wrong App ID in manifest or SDK | Recheck AppGallery Connect for correct ID |
| Works on Google devices but not Huawei | HMS dependency missing | Make sure Integrity SDK is included | | Works on Google devices but not Huawei | HMS dependency missing | Make sure Integrity SDK is included |
| Crashes only in release builds | HMS classes stripped by R8/ProGuard | Add the [ProGuard rules](#6-proguard-rules) |
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment