目录

Result Codes

Result Code

Value

Description

Solution

AWARENESS_SUCCESS_CODE

0

Success.

-

AWARENESS_UNKNOWN_ERROR_CODE

10000

Unknown error.

You can submit a ticket online. Huawei technical support will handle it in time.

AWARENESS_BINDER_ERROR_CODE

10001

Bind service failure caused by an empty binder.

Clear the app cache, restart the app, and try again.

AWARENESS_REGISTER_FAILED_CODE

10002

Barrier registration failure.

  • Possible causes for barrier registration failure: an error occurs in barrier parameter conversion, the Android SDK version is incorrect, Awareness Kit does not obtain your information, or Awareness Kit fails to be initialized.
  • Possible cause for beacon barrier registration failure: Awareness Kit fails to subscribe to HUAWEI Nearby Service.
  • Possible causes for Bluetooth barrier registration failure: The device does not support Bluetooth, the input value of deviceType is incorrect, or deviceType (the value is 0) supports only the Bluetooth car stereo type.
  • Possible cause for behavior barrier registration failure: Awareness Kit fails to subscribe to the MSDP service.

If a fault persists, verify that the call method is correct and the input parameters are valid.

AWARENESS_TIMEOUT_CODE

10003

Timeout error. For example, one of the following events times out: barrier update, time attribute obtaining, beacon status obtaining, bind service connection, and waiting for intent.

If a timeout error occurs, try again later. Alternatively, forcibly stop HMS Core and try again.

AWARENESS_COUNT_LIMIT_CODE

10004

Error due to the times limit. (For example, the number of barriers in BarrierUpdateRequest cannot exceed 200.)

When this error occurs, reduce the number of times that the barrier is accessed to optimize your app.

AWARENESS_FREQUENCY_LIMIT_CODE

10005

Error due to the access frequency limit of the barrier or capture, which is 1000 times per hour or 20 times every 5s. The total number of barriers to be registered in 5s cannot exceed 500.

Reduce the frequency of calling the barrier or capture API to improve the barrier access efficiency.

AWARENESS_BARRIER_PARAMETER_ERROR_CODE

10006

Invalid barrier parameter. (An input parameter of addBarrier is incorrect.)

Possible cause: During barrier registration, an input parameter is invalid. For example, to register an ambient light barrier, the input parameter must be a floating point number and must be greater than or equal to 0.

When creating a barrier, enter valid parameters. For details, please refer to the description of the barrier creation API.

AWARENESS_REQUEST_ERROR_CODE

10007

Incorrect request parameter. (An input parameter of updateBarriers is incorrect.)

Possible causes: An input parameter is set to null or is invalid when the updateBarriers API is called; no app UID exists in the service due to disconnection between your app and Awareness Kit.

Check whether invalid parameters are passed. If no invalid parameter is found, the app may fail to connect to Awareness Kit. Clear the app cache and restart the app.

AWARENESS_AGC_FILE_ERROR

10008

Incorrect AppGallery Connect file.

Possible causes: The agconnect-service file is missing. For example, collector_url is not found in service/analytics, app_id is not found in client, package_name is not found in client, or the agconnect-service file (for example, the value of collector_url is incorrect) is incorrect.

Check whether a data storage location is selected for the app in AppGallery Connect. If not, select a data storage location and download the agconnect-service.json file again.

AWARENESS_RESULT_INVALID_ERROR

10009

Invalid result returned by Awareness Kit. For example, the returned headset status is unknown.

Possible cause: The capture API call timed out.

Possible cause for the error occurred in the headset capture: Awareness Kit does not find the audio manager of the device, and therefore cannot obtain the headset status.

Possible cause for the error occurred in the ambient light capture: The device does not have a light sensor or the service cannot obtain the light sensor of the device; the light sensor of the device is insensitive or the ambient light does not change, as a result, the service times out to obtain the illumination value.

Check whether the related functions of the device are normal.

AWARENESS_REMOTE_EXCEPTION_ERROR

10010

The remote exception is thrown by the bind method.

Possible cause: A remote call exception (RemoteException) occurs when your app is trying to connect to Awareness Kit.

Run the bind method again.

AWARENESS_WAIT_CALLBACK_CODE

10011

Wait for the service callback.

Wait for the service callback. Generally, the result can be obtained within 15 seconds.

AWARENESS_INTERFACE_INVALID

10012

The requested API no longer provides services.

Generally, more friendly APIs are available for you in this case. You can select an alternative API of the same type.

AWARENESS_NO_ENOUGH_RESOURCE

10013

Insufficient system resources.

Possible cause: The number of apps that register with the barriers of this type has reached the upper limit.

Currently, a maximum of 20 apps can register with the beacon barrier function at the same time. When the number of apps that register with this function reaches 20, the registration of other apps will fail. Cancel the registration in apps that no longer use the beacon barrier function to ensure that the number of apps that use this function does not exceed 20.

AWARENESS_SDK_VERSION_ERROR

10100

Incorrect SDK version.

This service is available only on devices running Android API-Level 24 or higher.

AWARENESS_LOCATION_PERMISSION_CODE

10101

The location permission in the app is forbidden.

Assign the location permission first.

AWARENESS_LOCATION_CORE_PERMISSION_CODE

10102

The location permission in HMS Core (APK) is forbidden.

The location permission is not assigned in HMS Core (APK). Assign the location permission first.

AWARENESS_BEHAVIOR_PERMISSION_CODE

10103

The behavior recognition permission in the app is forbidden.

Assign the behavior recognition permission to the app and HMS Core.

AWARENESS_BLUETOOTH_PERMISSION_CODE

10104

The app does not apply for the Bluetooth permission.

Assign the Bluetooth permission. For details, please refer to Assigning Permissions in the Manifest File.

AWARENESS_WIFI_PERMISSION_CODE

10105

The Wi-Fi permission in the app is forbidden.

Assign the Wi-Fi permission. For details, please refer to Assigning Permissions in the Manifest File.

AWARENESS_WIFI_CORE_PERMISSION_CODE

10106

The Wi-Fi permission in HMS Core (APK) is forbidden.

Assign the Wi-Fi permission.

AWARENESS_LOCATION_NOCACHE_CODE

10200

No location caches.

Try again later.

AWARENESS_LOCATION_NOT_AVAILABLE_CODE

10201

HUAWEI Location Kit is unavailable.

Forcibly stop HMS Core and try again, or reinstall HMS Core and try again.

AWARENESS_BEACON_NOT_AVAILABLE_CODE

10300

The beacon service is unavailable.

Forcibly stop HMS Core and try again, or reinstall HMS Core and try again.

AWARENESS_BLUETOOTH_NOT_AVAILABLE_CODE

10400

The Bluetooth service is unavailable.

Ensure that the Bluetooth function is enabled on the device.

AWARENESS_APPLICATION_NOT_HUAWEI_PHONE

10500

Non-Huawei phones do not support app status awareness.

Non-Huawei phones do not support app status awareness. To use this function, use a Huawei phone.

UPDATE_KIT_CODE

1212

Awareness Kit needs to be updated.

Update Awareness Kit.

UPDATE_HMS_CODE

907135003

HMS Core (APK) needs to be updated.

Update HMS Core (APK).

AWARENESS_DONATE_NOT_AVAILABLE_CODE

10150

The data donation service is unavailable.

Make sure that the data donation service is supported on the device.

AWARENESS_DONATE_REMOTE_FAIL_CODE

10151

An error was reported during data donation.

Verify that the data to be donated complies with specifications related to the Donate API.

AWARENESS_LOCATION_FENCE_SERVICE_NOT_AVAILABLE_CODE

10202

The geofence service is unavailable.

Prompt the user to enable the geofence service.

If the error persists, submit a ticket online. Huawei will get back to you as soon as possible.