Troubleshooting & Testing
Testing without a physical Huawei device
You can validate most of the integration without owning a Huawei phone.
| Layer | What it proves | Needs Huawei account? | Needs device? |
|---|---|---|---|
| Client render | The SDK handles an HMS message and renders push + in‑app | ❌ | ❌ (any emulator) |
| Backend request | The HMS request shape / v1–v2 URL / auth headers | ❌ | ❌ |
Backend dry‑run (HMS_VALIDATE_ONLY=true) | Real OAuth + payload accepted by Huawei | ✅ credential | ❌ |
| Real delivery — Cloud Debugging | End‑to‑end push on a real Huawei device | ✅ | free remote device |
- Emulator note: HMS Core can be side‑loaded onto a standard Google emulator, but real push delivery is unreliable there — the cloud→device channel isn't supported on emulators. Use the emulator only as a "does it build / run" check.
- Cloud Debugging: AppGallery Connect → Quality → Cloud Debugging gives free remote access to real Huawei devices. Install your APK, obtain a real token, and trigger a push (from Engage or from Push Kit's test tool). This is the device‑free way to confirm actual delivery. First‑time use grants a 24‑hour budget (2 hours per reservation).
Common issues
| Symptom | Cause / Fix |
|---|---|
Could not find com.huawei.hms:push… at build time | Huawei Maven repo missing — add it to settings.gradle.kts (App Integration §2) |
com.android.tools.build:gradle is not set | AGP not on the buildscript classpath — add the classpath("com.android.tools.build:gradle:…") line (App Integration §3) |
Token not obtained / 907135702 | SHA‑256 fingerprint not registered or wrong ([AppGallery Setup §4](../../Push Credentials/huawei-hms.md)) |
| Cannot create an Android app (only Web selectable) | Developer account not verified yet (Trial mode) — wait for enterprise verification |
80200001 / 80200003 | OAuth auth error / expired token — check HMS_CLIENT_ID/HMS_CLIENT_SECRET; token is refreshed automatically |
80300007 | All tokens invalid — token/package/appID mismatch or wrong send URL |
80100000 + illegal_tokens | Partial success; dead tokens are retired automatically by the backend |
| No HMS push on the emulator | Expected — use Cloud Debugging or a real Huawei device |
Push Kit response codes
Huawei returns the real result in the JSON body's code field (HTTP is 200 even on partial
failure):
80000000— success (also returned for a passingvalidate_onlydry‑run; nothing delivered).80100000— partial success;illegal_tokenslists the dead tokens.80300007— all tokens invalid.80200001/80200003— OAuth authentication error / expired access token.80300008— message body (excluding tokens) exceeds 4 KB.80300010— too many tokens in one request (>1000).
FCM is never affected
HMS is additive. When HMS_* variables are unset, the HMS path does nothing and FCM behaves
exactly as before. On the client, GMS‑less handling is safely skipped on GMS devices. You can adopt
HMS without any risk to your existing FCM delivery.