目录

ArkTS API Error Codes

This section describes only error codes related to Game Service Kit. For details about universal error codes, please refer to Universal Error Codes.

1010300001 Internal System Error

Error Message

System internal error.

Error Description

Internal system error.

Possible Causes

An internal error occurs in Game Service Kit.

Solution

Try again, or restart the device and try again. If the retry fails, submit a ticket online. Huawei will get back to you as soon as possible.

1010300002 Authentication Failure

Error Message

Auth failed.

Error Description

Authentication failure.

Possible Causes

The network connection is abnormal, or a parameter passed is invalid.

Solution

  1. For the first sign-in on a device, check whether the network is properly connected.

  2. Ensure that the parameters passed to the init API are valid.

1010300003 Invalid Request

Error Message

Invalid request.

Error Description

Invalid request.

Possible Causes

Solution

1002000001 Internal Game Error

Error Message

System internal error.

Error Description

Internal game error.

Possible Causes

The possible causes are as follows:

Solution

  1. Ensure the size of the official game account icon does not exceed 35 KB.

  2. Ensure that input parameter context of each API meets the requirements.

    • You are advised to obtain the context in the UI component as follows:

      let context = this.getUIContext()?.getHostContext() as common.UIAbilityContext;
    • The context cannot be directly obtained outside the UI component.

      You are advised to obtain the context from EntryAbility and save it to AppStorage, and then use AppStorage to obtain the context. For details, please refer to AppStorage: Storing Application-wide UI State.

  3. Check whether a simulator is used to debug the API. The Game Service Kit API cannot be debugged using a simulator.

  4. Go to Settings > Mobile network > Manage data usage > Network access > WLAN, tap Show system programs in the upper right corner, and check whether the switch for game service system program is enabled.

  5. Submit a ticket online. Huawei will get back to you as soon as possible.

1002000002 Network Error

Error Message

Network connection error.

Error Description

A network error occurs.

Possible Causes

The possible causes are as follows:

Solution

  1. Ensure that configuration items are correctly set. For details, please refer to Preparations.

  2. Adjust the system time on the device to the correct time.

  3. Ensure that the network connection is working properly.

1002000003 No HUAWEI ID Information Is Found

Error Message

The HUAWEI ID is not signed in or not authorized.

Error Description

No HUAWEI ID information is found.

Possible Causes

The user has signed out of their HUAWEI ID on the device.

Solution

Ensure that the user has signed in using a HUAWEI ID and granted authorization.

1002000004 Identity Verification Is Required But the Player Cancels It or Identity Verification Has Not Been Performed

Error Message

User cancels real name authentication or not real name.

Error Description

Identity verification is required but the player cancels it or identity verification has not been performed.

Possible Causes

Identity verification is required but the player cancels it or identity verification has not been performed.

Solution

Call the unionLogin API to instruct the player to perform identity verification again.

1002000005 Only HUAWEI IDs with Both the Service Area and Registration Location Within the Chinese Mainland Are Supported

Error Message

The country or region of the signed-in Huawei ID does not support.

Error Description

Only HUAWEI IDs with both the service area and registration location within the Chinese mainland are supported.

Possible Causes

The service area or registration location of the HUAWEI ID may not be within the Chinese mainland.

Solution

When a user attempts to sign in to the game, prompt them to use or register a HUAWEI ID whose service area and registration location are both within the Chinese mainland.

1002000006 The Player Is a Minor and the Current Time Is Not Within the Permitted Game Duration

Error Message

User is underage and has no playable time.

Error Description

The player is a minor and the current time is not within the permitted game duration.

Possible Causes

The player is a minor and the current time is not within the permitted game duration.

Solution

Check whether the current game time of the minor is between 20:00 to 21:00 on Friday, Saturday, Sunday, or legal holidays.

1002000007 The App to Which the Product Belongs Is Not Released to Specified Countries or Regions

Error Message

The application to which the product belongs is not listed in the specified country.

Error Description

The app to which the product belongs is not released to specified countries or regions.

Possible Causes

The app to which the product belongs is not released to specified countries or regions.

Solution

Sign in to AppGallery Connect. Click My apps, select an app, and go to Distribute > Version information > Draft. Then check the countries or regions to which the app will be released.

1002000008 The HUAWEI ID Is in the Blocklist

Error Message

The HUAWEI ID is in the blocklist.

Error Description

The HUAWEI ID is in the blocklist.

Possible Causes

Solution

1002000009 Third-Party Game Accounts Are Not Supported Currently

Error Message

The game account is unavailable for the game.

Error Description

Third-party game accounts are not supported currently.

Possible Causes

The account used for sign-in is invalid.

Solution

Use another game account.

1002000010 teamPlayerId Does Not Match the Current Player

Error Message

The playerId is not current player.

Error Description

teamPlayerId does not match the current player.

Possible Causes

An incorrect value of teamPlayerId is passed when the bindPlayer or unbindPlayer API is called.

Solution

Check whether the value of teamPlayerId is correct, and call the bindPlayer or unbindPlayer API again to pass the correct value.

1002000011 Player Does Not Agree to the Privacy Statement

Error Message

Agreement not agreed.

Error Description

The player does not agree to the privacy statement.

Possible Causes

The player cancels the privacy agreement, or another API is called before the init API is successfully called.

Solution

Call the init API again.

1002000012 The Official Game Account Has Been Associated with teamPlayerId

Error Message

The thirdOpenId or teamPlayerId has been bound.

Error Description

The official game account has been associated with teamPlayerId.

Possible Causes

When the bindPlayer API is called, the official game account has been associated with teamPlayerId.

Solution

No action is required.

1002000013 The Official Game Account Is Not Associated with teamPlayerId

Error Message

The thirdOpenId and teamPlayerId are not bound.

Error Description

The official game account is not associated with teamPlayerId.

Possible Causes

When the unbindPlayer API is called, the official game account is not associated with teamPlayerId.

Solution

No action is required.

1002000014 This API Is Not Available for This Game

Error Message

This interface is not available for this game.

Error Description

This API is not available for this game.

Possible Causes

This API cannot be called by the current game.

Solution

  1. Check whether an error is reported when the game calls the unionLogin API.

  2. If yes, try an API other than unionLogin.

  3. If the error persists, submit a ticket online. Huawei will get back to you as soon as possible. If the error is not reported, the current game does not have permission to use the unionLogin API. In this case, use another API.

  4. If your game does not have permission to use the unionLogin API but wants to use it again, submit a ticket online. Huawei will get back to you as soon as possible.

1002000015 The Player Information Is Invalid

Error Message

The current player information is invalid. Execute the login process again to obtain the player information.

Error Description

The player information is invalid.

Possible Causes

The user switches to another HUAWEI ID after signing in to the game. As a result, the current player information in the game becomes invalid.

Solution

Call the unionLogin API again to obtain the player information.

1002000016 The Player Cancels Multi-provider Sign-In

Error Message

Union login canceled by user.

Error Description

The player cancels multi-provider sign-in.

Possible Causes

The player cancels multi-provider sign-in during the multi-provider sign-in process.

Solution

To continue the sign-in, call the unionLogin API again.

1002000017 Invalid App

Error Message

Illegal application identity.

Error Description

Invalid app.

Possible Causes

The configuration such as the client ID, app ID, and signature is incorrect or missing.

Solution

Ensure that information such as the signing certificate fingerprint, app ID, and client ID is correctly configured. Add or modify the configurations as required.

1002000018 API Available Only for Mini Games

Error Message

This API is only provided for HarmonyOS mini games.

Error Description

This API is available only for mini games.

Possible Causes

This API is used in a game that is not a mini game.

Solution

Use a supported API.

1002000019 Invalid Parameter

Error Message

Parameter error.

Error Description

Invalid parameter.

Possible Causes

Solution

Pass parameters according to the relevant requirements. Ensure that all mandatory parameters are specified and that all parameters are of the valid types.

1002000020 Current Operation Canceled by the User

Error Message

The operation was canceled by the user.

Error Description

The current operation is canceled by the user.

Possible Causes

The user canceled the current operation.

Solution

Display a message to the user, indicating that the operation is canceled.

1002000021 Excessive API Call Frequency

Error Message

Too frequent API calls.

Error Description

Excessive API call frequency.

Possible Causes

The API is called too frequently.

Solution

Avoid excessive API calls. The current default access interval for the API is 5 seconds.

1002000050 Invalid Product Information

Error Message

Invalid product information.

Error Description

Invalid product information.

Possible Causes

  1. The passed product ID or type is incorrect.

  2. The product created in AppGallery Connect has not been submitted for review or has not been approved. For details about how to create a product and submit it for review, please refer to Adding a Single Product.

Solution

Sign in to AppGallery Connect. Click My apps, select an app, and go to Operate > Products > Product Management. In the product list, check whether the product exists, and if so, check whether all its mandatory information is provided and has been approved. If the product fails to be approved, use a sandbox account for testing. For details, please refer to Sandbox Testing.

1002000051 Purchase Failure Because the User Already Owns the Product

Error Message

Failed to purchase a product because the user already owns the product.

Error Description

The purchase failed because the user already owns the product.

Possible Causes

The product has already been purchased.

Solution

Use the queryPurchases API to check whether the user has purchased the product.

1002000052 Delivery Failed Because the Product Was Not Paid For

Error Message

The purchase cannot be finished because the user has not paid for it.

Error Description

Failed to deliver the product because the user has not paid for it.

Possible Causes

The user has not purchased the product.

Solution

Use the queryPurchases API to check whether the user has purchased the product.

1002000053 Repeated Delivery

Error Message

The purchase has been finished and cannot be finished again.

Error Description

The product has been delivered. No more delivery is needed.

Possible Causes

The product has been delivered. No more delivery is needed.

Solution

Use the queryPurchases API to check whether there is a delivery confirmation record for the product.

1002000054 Service Area Unsupported by IAP Kit

Error Message

The country or region of the signed-in HUAWEI ID does not support IAP.

Error Description

The country or region to which the signed-in HUAWEI ID belongs is not supported by IAP Kit.

Possible Causes

The country or region to which the signed-in HUAWEI ID belongs is not supported by IAP Kit.

Solution

For signed-in HUAWEI IDs whose service area is not within the Chinese mainland, you are advised to hide the entry points for related payment functions in your app.

1002000056 Transaction Rejected

Error Message

The user is not allowed to make purchase.

Error Description

The user transaction is rejected.

Possible Causes

The transaction behavior triggers IAP Kit's risk control.

Solution

Try again later or change the payment method.

1018300001 Internal Game Error

Error Message

System internal error.

Error Description

Internal game error.

Possible Causes

The input parameter cannot be parsed.

Solution

  1. Check whether the input parameter is correct.
  2. If the error persists, submit a ticket online. Huawei will get back to you as soon as possible.

1018300002 Authentication Failure

Error Message

Authentication failed.

Error Description

Authentication failure.

Possible Causes

The network connection is abnormal, or a parameter passed is invalid.

Solution

  1. For the first sign-in on a device, check whether the network is properly connected.

  2. Ensure that the parameters passed to the create API are valid.

1018300003 Invalid Request

Error Message

Invalid request.

Error Description

Invalid request.

Possible Causes

Other APIs are called when the nearby transfer service has not been created or fails to be created.

Solution

Call the create API first and ensure that the call is successful.

1018300004 Service Unavailable

Error Message

No service available.

Error Description

Service unavailable.

Possible Causes

No nearby devices can be bound to.

Solution

After confirming that the receiver has published the nearby transfer service, try discovering a device again and bind to the service.

1018300005 WLAN and Bluetooth Must Be Enabled

Error Message

The wireless network and Bluetooth should be enabled at the same time.

Error Description

WLAN and Bluetooth must be enabled at the same time.

Possible Causes

WLAN and Bluetooth are not enabled simultaneously on the device where the game is installed.

Solution

Enable WLAN and Bluetooth on the device simultaneously.

1018300006 Publishing Failed

Error Message

Publishing failed.

Error Description

Publishing failed.

Possible Causes

Publishing failed.

Solution

Internal system error. Try publishing the nearby transfer service again.

1018300007 Discovery Failed

Error Message

Discovery failed.

Error Description

Discovery failed.

Possible Causes

No device is found.

Solution

After confirming that the receiver has published the nearby transfer service, try discovering a device again.

1018300008 Invalid Parameter

Error Message

Invalid parameter.

Error Description

Invalid parameter.

Possible Causes

  1. The mandatory parameter is empty.

  2. The parameter type is incorrect.

  3. Parameter verification failed.

Solution

Pass parameters according to the relevant requirements. Ensure that all mandatory parameters are specified and that all parameters are of the valid types.