Skip to main content

Troubleshooting & Testing

Testing without a physical Huawei device

You can validate most of the integration without owning a Huawei phone.

LayerWhat it provesNeeds Huawei account?Needs device?
Client renderThe SDK handles an HMS message and renders push + in‑app❌ (any emulator)
Backend requestThe 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 DebuggingEnd‑to‑end push on a real Huawei devicefree 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

SymptomCause / Fix
Could not find com.huawei.hms:push… at build timeHuawei Maven repo missing — add it to settings.gradle.kts (App Integration §2)
com.android.tools.build:gradle is not setAGP not on the buildscript classpath — add the classpath("com.android.tools.build:gradle:…") line (App Integration §3)
Token not obtained / 907135702SHA‑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 / 80200003OAuth auth error / expired token — check HMS_CLIENT_ID/HMS_CLIENT_SECRET; token is refreshed automatically
80300007All tokens invalid — token/package/appID mismatch or wrong send URL
80100000 + illegal_tokensPartial success; dead tokens are retired automatically by the backend
No HMS push on the emulatorExpected — 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 passing validate_only dry‑run; nothing delivered).
  • 80100000 — partial success; illegal_tokens lists 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.