目录

Animation and Visual Effects Error Codes

This topic describes only module-specific error codes. For details about universal error codes, see Universal Error Codes.

106211 Attribute Not Found

Error Message

The attribute was not found because it was not set before.

Description

This error code is reported when the attribute is not found because it was not set before.

Possible Causes

When an API is called to obtain an attribute value, the attribute was not set through the corresponding setting API before. For example, when OH_ArkUI_NativeModule_PropertyAnimation_GetFromValue is called, the attribute was not set through OH_ArkUI_NativeModule_PropertyAnimation_SetFromValue before.

Solution

Set the attribute through the corresponding setting API first, and then call the API to obtain the attribute value.

106212 Invalid Sub-animation Parameter

Error Message

The sub-animation parameter is invalid.

Description

This error code is reported when the sub-animation parameter added to the animation group is invalid.

Possible Causes

  1. When a property animation is added through OH_ArkUI_NativeModule_AnimationGroup_AddPropertyAnimation: the end value is not set for the property animation (OH_ArkUI_NativeModule_PropertyAnimation_SetToValue is not called).
  2. When a keyframe animation is added through OH_ArkUI_NativeModule_AnimationGroup_AddKeyframeAnimation: the keyframe time points are in an incorrect order (a subsequent keyframe time point is smaller than the previous one), or the ArkUI_NumberValue values corresponding to propertyType passed in during the keyframe animation creation are not completely set through OH_ArkUI_NativeModule_KeyframeAnimation_SetValue or OH_ArkUI_NativeModule_KeyframeAnimation_SetValues.
  3. When an animation group is registered through OH_ArkUI_NativeModule_AddAnimationGroup: the sub-animation does not have a target render node set, and the animation group does not have a default target render node set either, so the target node cannot be resolved.

Solution

  1. Ensure that the end value is set for the property animation through OH_ArkUI_NativeModule_PropertyAnimation_SetToValue.
  2. Ensure that the ArkUI_NumberValue value corresponding to the propertyType is set for each keyframe of the keyframe animation through OH_ArkUI_NativeModule_KeyframeAnimation_SetValue or OH_ArkUI_NativeModule_KeyframeAnimation_SetValues. When setting keyframe time points through OH_ArkUI_NativeModule_KeyframeAnimation_SetKeyTime, ensure that the keyframe time points are in the correct order (a subsequent keyframe time point is not smaller than the previous one).
  3. Set the target render node for the sub-animation through OH_ArkUI_NativeModule_PropertyAnimation_SetTargetNode, OH_ArkUI_NativeModule_KeyframeAnimation_SetTargetNode, or OH_ArkUI_NativeModule_PathAnimation_SetTargetNode, or set the default target render node of the animation group through OH_ArkUI_NativeModule_AnimationGroup_SetTargetNode.

106213 Specified Animation Group Not Found on the UIContext

Error Message

The animation group is not found on the UIContext.

Description

This error code is reported when the animation group identified by the specified key is not found on the UIContext.

Possible Causes

  1. A key that has not been registered through OH_ArkUI_NativeModule_AddAnimationGroup is used to search for the animation group.
  2. The animation group has finished playing and is automatically removed by the system after the animation ends.

Solution

Confirm that the key has been registered through OH_ArkUI_NativeModule_AddAnimationGroup and that the animation group has not ended yet. After the animation group ends naturally, OH_ArkUI_NativeModule_FinishAnimationGroup is called, or the target node is destroyed, the animation end callback is triggered, and the system automatically removes the animation group after the callback is executed. If necessary, use OH_ArkUI_NativeModule_HasAnimationGroup to check whether the animation group exists.

106214 Re-entrant Call to Animation Group APIs Detected on the Same Thread

Error Message

A re-entrant call to animation group APIs is detected on the same thread.

Description

This error code is reported in the following scenario: On the same thread, while a call to an animation group API has not yet returned, the thread makes a nested call to another animation group API.

Possible Causes

On the same thread, while a call to an animation group API has not yet returned, the thread makes a nested call to another animation group API.

Solution

Ensure that the next call to an animation group API is made only after the previous call has fully returned, and avoid nested calls to animation group APIs on the same thread.

106215 Animation Group Not in the Required State for the Operation

Error Message

The animation group is not in the required state for the operation.

Description

This error code is reported when the current state of the animation group does not meet the state required for the API call.

Possible Causes

  1. When OH_ArkUI_NativeModule_PauseAnimationGroup is called, the animation group is not in the OH_ARKUI_ANIMATION_GROUP_STATE_RUNNING state.
  2. When OH_ArkUI_NativeModule_ResumeAnimationGroup is called, the animation group is not in the OH_ARKUI_ANIMATION_GROUP_STATE_PAUSED state.
  3. When OH_ArkUI_NativeModule_FinishAnimationGroup is called, the animation group is not in the OH_ARKUI_ANIMATION_GROUP_STATE_RUNNING or OH_ARKUI_ANIMATION_GROUP_STATE_PAUSED state.

Solution

Query the current state of the animation group through OH_ArkUI_NativeModule_GetAnimationGroupState, and call the corresponding API only after confirming that the state is correct.

106216 Resolved Target Node Not Belong to the UIContext of the Context Passed for Registering the Animation Group

Error Message

The resolved target node does not belong to the same UIContext as the context parameter.

Description

This error code is reported when the resolved target node does not belong to the same UIContext as the context.

Possible Causes

When an animation group is registered through OH_ArkUI_NativeModule_AddAnimationGroup, the UIContext to which the target render node resolved by the sub-animation belongs is inconsistent with the UIContext to which the context parameter belongs.

Solution

Ensure that the target render node set for the sub-animation through OH_ArkUI_NativeModule_PropertyAnimation_SetTargetNode, OH_ArkUI_NativeModule_KeyframeAnimation_SetTargetNode, or OH_ArkUI_NativeModule_PathAnimation_SetTargetNode, or the default target render node of the animation group set through OH_ArkUI_NativeModule_AnimationGroup_SetTargetNode belongs to the same UIContext as the context passed when registering the animation group.