• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

Result Code 6004 Reported When an HMS Core SDK API Is Called

Search This thread

Mayism

Senior Member
Nov 5, 2020
130
25
github.com
After my game integrated the HMS Core SDK, players could not sign in to my game. When the getCurrentPlayer API was called, result code 6004 was returned. I searched the keyword hmssdk in log information and found the following error information:
Line 291: I/HMSSDK_HmsClient: receive msg status_code:0, error_code6004, api_name:game.getCurrentPlayer
0*LdBeM7izbnggDFnz.png

According to the result code description, this result code indicates that permission is not granted from HUAWEI Developers.

Solution
Since the result code indicates that the required permission has not been granted, I checked the API enabling status by referring to Enabling Services.
0*rr3VaSd_jIPp_QVC.png

It was found that all involved services had been enabled. That means I had required permissions. It was really confusing. So i contacted Huawei technical support. They offered me this solution:
If the required API is not enabled, enable it. Then wait for about 15 minutes, clear the HMS Core (APK) cache on the test phone, and check whether sign-in can be successful.
If the API has been enabled, the possible cause is that an exception occurs when the API is enabled, which rarely happens. As a result, Huawei server does not receive the synchronized API enabling request. In this case, you can manually disable the API and then enable it again to trigger message synchronization. Similarity, clear the HMS Core (APK) cache, wait for 15 minutes, and perform the test again.

To clear the HMS Core (APK) cache, go to Settings > Apps > Apps > HMS Core on your test device, and clear the cache.
I tried the latter solution, and my game can be signed in properly again.