Compilation Error Codes

NOTE

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

10905301 @Watch Decorator Callback Function Is Not Defined

Error Message
'@Watch' cannot be used with 'xxx'. Apply it only to parameters that correspond to existing methods.

Description
This error code is reported when the callback function for the @Watch decorator is not defined.

Possible Cause
The variable decorated with @Watch is defined in the struct, but the corresponding callback function is missing.

Solution
Define a callback function with the same name in the struct to handle the watched variable.

10905101 @BuilderParam Initialization Error

Error Message
'@BuilderParam' property can only initialized by '@Builder' function or '@LocalBuilder' method in struct.

Description
This error code is reported when @BuilderParam decorated variables are initialized using methods other than those decorated with @Builder.

Possible Cause
The @BuilderParam decorated variable is being initialized using a regular function or variable of another type.

Solution
Define functions decorated with @LocalBuilder or @Builder and use them to initialize variables decorated with @BuilderParam.

10905302 Mixed Use of Multiple State Management Decorators

Error Message
The property 'xxx' cannot have multiple state management decorators.

Description
This error code is reported when a variable is decorated with multiple state management decorators.

Possible Cause
The same variable is decorated with multiple state management decorators.

Solution
Use only one appropriate state management decorator for the variable.

10905303 State Variable Initialization Verification Exception

Error Message
The 'xxx' property 'yyy' must be specified a default value.

Description
This error code is reported when variables decorated with @State, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, or @Provide are not initialized.

Possible Cause
Variables decorated with @State, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, or @Provide are not initialized.

Solution
Initialize variables decorated with @State, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, and @Provide.

10905304 Failed to Verify the Initialization of a Specific Decorated Variable

Error Message
The 'xxx' property cannot be specified a default value.

Description
This error code is reported when initialization is performed on variables decorated with decorators such as @Consume, @Link, and @ObjectLink.

Possible Cause
Initialization is performed when defining variables decorated with decorators such as @Consume, @Link, and @ObjectLink.

Solution
Do not initialize variables decorated with @Consume, @Link, and @ObjectLink. Refer to the correct value assignment rules for decorators.

10905305 Variable Type Verification Exception

Error Message
The property 'xxx' must specify a type.

Description
This error code is reported when the type is not specified for a variable decorated with a decorator.

Possible Cause
The type is not specified for a variable decorated with a decorator.

Solution
Specify the type for the variable decorated with the decorator.

10905307 Failed to Verify the Specific Decorated Variable Type

Error Message
'@ObjectLink' cannot be used with this type. Apply it only to classes decorated by '@Observed' or initialized using the return value of 'makeV1Observed'.

Description
This error code is reported when the type of a variable decorated with @ObjectLink is not a class or union type decorated with @Observed defined in an .ets file.

Possible Cause
The variable decorated with @ObjectLink is initialized using a class that is not decorated with @Observed or another incompatible type.

Solution
Ensure that class instances decorated with @Observed are used with @ObjectLink.

10905308 Failed to Verify the Decorator of a Specific Variable Type

Error Message
The 'xxx' property 'yyy' cannot be a 'zzz' object.

Description
This error code is reported when a variable decorated with @State or other state decorators is of type CustomDialogController.

Possible Cause
A state variable decorator is used on a variable of type CustomDialogController.

Solution
Do not use state variable decorators on variables of type CustomDialogController.

10905309 Custom Decorator Name Verification Error

Error Message
The decorator 'xxx' cannot have the same name as the built-in style attribute 'yyy'.

Description
This error code is reported when a custom decorator has the same name as a built-in property.

Possible Cause
The custom decorator name conflicts with a built-in property name.

Solution
Rename the custom decorator to avoid conflicts with built-in property names.

10905310 @Watch Decorator Verification Error

Error Message
Regular variable 'xxx' can not be decorated with '@Watch'.

Description
This error code is reported when a regular variable is decorated with @Watch.

Possible Cause
The @Watch decorator is used on a regular variable.

Solution
Use @Watch only on state variables decorated with appropriate state variable decorators, such as @State.

10905311 @Watch Decorator Parameter Verification Error

Error Message
'@Watch' cannot be used with 'xxx'. Apply it only to 'string' parameters.

Description
This error code is reported when the parameter of the @Watch decorator is not a string.

Possible Cause
A non-string value is used as the parameter for the @Watch decorator.

Solution
Ensure that the parameter of the @Watch decorator is a string.

10905312 Custom Decorator Verification Exception

Error Message
The inner decorator 'xxx' cannot be used together with custom decorator.

Description
This error code is reported when built-in component decorators such as @State are used together with custom decorators.

Possible Cause
A custom decorator is applied to a variable that already has a built-in component decorator, such as @State.

Solution
Avoid using both state variable decorators (such as @State) and custom decorators on the same variable.

10905201 Parent Component Verification Error

Error Message
The 'xxx' component can only be nested in the 'yyy' parent component.

Description
This error code is reported when a component's parent is not the specified parent component.

Possible Cause
The parent component of a component (for example, Blank) is not within the allowed range of parent components.

Solution
Modify the parent component or add an intermediate component based on the error description.

10905202 Failed to Verify the Child Component of the Button Component

Error Message
The Button component with a label parameter can not have any child.

Description
This error code is reported when a Button component with a label contains child components.

Possible Cause
The Button component includes both a label and child components, which is not allowed.

Solution
Remove either the label content or the child component content (including the braces).

10905203 .stateStyles Syntax Check Error

Error Message
'.stateStyles' doesn't conform standard.

Description
This error code is reported when the stateStyles property does not comply with the syntax.

Possible Cause
The stateStyles property is incorrectly specified or does not conform to the required syntax.

Solution
Ensure that different states in stateStyles are correctly specified.

10905204 UI Component Syntax Check Error

Error Message
'xxx' does not meet UI component syntax.

Description
This error code is reported when a statement does not comply with the UI component syntax.

Possible Cause
The code does not follow the basic UI component syntax.

Solution
Modify the syntax according to the correct UI component syntax.

10905207 Failed to Verify the then Clause of the if Statement

Error Message
Then statement cannot be null in if statement.

Description
This error code is reported when the if statement is missing a then clause.

Possible Cause
The then statement in the if syntax is empty.

Solution
Add a valid then clause after the if statement.

10905208 Failed to Verify the Judgment Condition of the if Statement

Error Message
Condition expression cannot be null in if statement.

Description
This error code is reported when the if statement is missing a condition.

Possible Cause
The judgment condition of the if statement is empty.

Solution
Add a valid condition to the if statement.

10905102 @BuilderParam Tail Closure Scenario Verification Exception

Error Message
In the trailing lambda case, 'xxx' must have one and only one property decorated with '@BuilderParam', and its '@BuilderParam' expects no parameter.

Description
This error code is reported when multiple variables decorated with @BuilderParam are defined in the trailing closure scenario, or a variable decorated with @BuilderParam contains parameters.

Possible Cause
In the trailing closure scenario, there can be only one variable decorated with @BuilderParam (excluding parameters).

Solution
Remove unnecessary @BuilderParam decorators and retain only one @BuilderParam decorator without parameters.

10905209 UI Syntax Verification Error with the build() Method

Error Message
Only UI component syntax can be written here.

Description
This error code is reported when content other than UI syntax is used.

Possible Cause
Non-UI syntax is used.

Solution
Modify the syntax according to the correct UI component syntax.

10905210 Root Container Verification Error with the build() Method

Error Message
In an '@Entry' decorated component, the 'build' method can have only one root node, which must be a container component.

Description
This error code is reported when multiple root containers are defined in the build() method.

Possible Cause
Multiple root containers are defined in the build() method.

Solution
Remove redundant root containers to ensure that the build() method has only one root container.

10905103 Failed to Verify the build() Method

Error Message
The struct 'xxx' must have at least and at most one 'build' method.

Description
This error code is reported when multiple build() methods are defined in the struct component, or the build() method is missing.

Possible Cause
Multiple build() methods are defined in the struct, or the build() method is missing.

Solution
Define only one build() method in the struct.

10905211 Failed to Verify @CustomDialog Member Properties

Error Message
The '@CustomDialog' decorated custom component must contain a property of the CustomDialogController type.

Description
This error code is reported when a custom component decorated with @CustomDialog lacks a member property of the CustomDialogController type.

Possible Cause
The custom component decorated with @CustomDialog does not have a member property of the CustomDialogController type.

Solution
Add a member property of the CustomDialogController type to the custom component decorated with @CustomDialog.

10905212 Struct Verification Error

Error Message
Structs are not allowed to inherit from classes or implement interfaces.

Description
This error code is reported when a struct is defined as a subclass or implementation of another class or API.

Possible Cause
The struct extends another class or implements another API.

Solution
Do not use structs to extend other classes or implement other APIs.

10905104 Failed to Verify the Static Method Decorator of the Custom Component

Error Message
Static methods in custom components cannot be decorated by '@LocalBuilder'.

Description
This error code is reported when the @LocalBuilder decorator is used on static methods in custom components.

Possible Cause
The @LocalBuilder decorator is used on static methods.

Solution
Remove the static keyword.

10905105 @Styles Decorator Verification Error

Error Message
'@Styles' decorated functions and methods cannot have arguments.

Description
This error code is reported when parameters are included in functions decorated with @Styles.

Possible Cause
Parameters are included in functions decorated with @Styles.

Solution
Remove the parameters from the @Styles decorator.

10905106 Failed to Verify the build() Method

Error Message
The 'build' method can not have arguments.

Description
This error code is reported when parameters are included in the build() method.

Possible Cause
Parameters are included in the build() method.

Solution
Remove the parameters from the build() method.

10905313 Failed to Verify the Struct Variable

Error Message
The static variable of struct cannot be used together with built-in decorators.

Description
This error code is reported when a built-in decorator is used to decorate a static variable in the struct.

Possible Cause
A built-in decorator is used to decorate a static variable in the struct.

Solution
Do not use built-in decorators to decorate static variables in structs.

10905314 $ Use Verification Error

Error Message
Property 'xxx' cannot initialize using '$' to create a reference to a variable.

Description
This error code is reported when $ is used incorrectly to decorate a variable. $ can only be used on child component attributes decorated with @Link.

Possible Cause
The $ symbol is used to decorate a property member that is decorated with @Prop or other property members not decorated with @Link in a child component.

Solution
Use the @Link decorator to decorate the corresponding variable in the child component, or remove $.

10905315 Parent and Child Component Value Verification Exception

Error Message
The 'xxx' property 'yyy' cannot be assigned to the 'zzz' property 'nnn'.

Description
This error code is reported when the value assignment between parent and child components is incorrect.

Possible Cause
A regular variable is used to initialize a member variable decorated with @Link in a child component.

Solution
Do not use regular variables to initialize member variables decorated with @Link in child components.

Error Message
The property 'xxx' in the custom component 'yyy' is missing (mandatory to specify).

Description
This error code is reported when variables decorated with @Link are not initialized from the parent component.

Possible Cause
The member variable decorated with @Link in the child component is not initialized when the parent component calls the child component.

Solution
Initialize variables decorated with @Link from the parent component.

10905317 Failed to Verify the Initialization of a Decorated Variable

Error Message
The property 'xxx' in the custom component 'yyy' cannot be initialized here (forbidden to specify).

Description
This error code is reported when variables decorated with @StorageProp, @StorageLink, @Consume, or other decorators are initialized when a parent component calls a child component.

Possible Cause
Member variables decorated with @StorageProp, @StorageLink, and @Consume are initialized when the parent component calls the child component.

Solution
Correctly use variables decorated with the @StorageProp, @StorageLink, or @Consume decorator. For details, see the reference documentation of these decorators.

10905318 Verification Error During Parent-to-Child Transfer Using !! with a V2 Component

Error Message
When the two-way binding syntax is used, the initial value of property 'xxx' must be a variable.

Description
This error code is reported when non-variables are used for parent-child transfer using !! with a V2 component.

Possible Cause
Functions, constants, or literals are used for parent-child transfer using !! with a V2 component.

Solution
When using !! with a V2 component for parent-child transfer, make sure only variables are used.

10905319 Child Component Variable Verification Error During !! Use with a V2 Component

Error Message
When the two-way binding syntax is used, the variable 'xxx' must be decorated with '@Param', and the '@Event' variable 'yyy' must be defined in the 'zzz'.

Description
This error code is reported when @Param is not used together with @Event when !! is used with a V2 component.

Possible Cause
When a V2 component is used, the child component variable is not decorated with @Param or the @Event decorated callback method is not defined.

Solution
Use @Param to decorate child component variables and define the callback method decorated with @Event in the V2 scenario.

10905320 @Param Initialization Verification Error in the V2 Scenario

Error Message
The optional character can not be used in the initial value of property 'xxx'.

Description
This error code is reported when optional symbols are used to transfer @Param decorated variables defined by child components in the V2 scenario.

Possible Cause
In the V2 scenario, an optional symbol is used for initializing an @Param decorated variable in the child component.

Solution
Avoid using optional symbols when initializing variables decorated with @Param in the V2 scenario.

10905321 Failed to Verify the Initialization of @Prop and @BuilderParam Decorated Variables

Error Message
'@Required' decorated 'xxx' must be initialized through the component constructor.

Description
This error code is reported when the initialization of the @Prop and @BuilderParam decorated variables is incorrect.

Possible Cause
The @Require decorator is used with @Prop and @BuilderParam to decorate child component variables, but these variables fail to be initialized when the parent component calls the child component.

Solution
Make sure variables decorated with @Require, @Prop, or @BuilderParam are initialized when the parent component calls the child component.

10905213 Incorrect Mixed Use of V1 and V2 Components

Error Message
A V2 component cannot be used with any member property decorated by '@Link' in a V1 component.

Description
This error code is reported when a V2 component is used together with the @Link decorator of a V1 component.

Possible Cause
V1 components containing the @Link decorator are used within V2 components.

Solution
Avoid using V1 components with the @Link decorator in V2 components.

10905323 V2 Decorator Decorated Properties Incorrectly Assigned to V1 Components

Error Message
Property 'xxx' in the '@ComponentV2' component 'yyy' is not allowed to be assigned values here.

Description
This error code is reported when a property decorated with a V2 decorator is assigned to a V1 component.

Possible Cause
The V1 component called is assigned with a property decorated with a V2 decorator.

Solution
Do not assign values of properties decorated with V2 decorators to V1 components.

10905324 Incorrect Initialization of a Specific Decorated Variable

Error Message
The 'xxx' property 'yyy' in the custom component 'zzz' cannot be initialized here (forbidden to specify).

Description
This error code is reported when variables decorated with specific decorators are initialized during parent-child component calls.

Possible Cause
A variable decorated with a specific decorator in a child component is not correctly initialized when called in the parent component.

Solution
Follow the usage guidelines of the specific decorators.

10905325 Incorrect Use of @Require in the V2 Scenario

Error Message
In a struct decorated with '@ComponentV2', '@Require' can only be used with '@Param'.

Description
This error code is reported when the @Require decorator is used with a decorator other than @Param in the V2 scenario.

Possible Cause
The @Require decorator is used with a decorator other than @Param in the V2 scenario.

Solution
Use @Require together with @Param.

10905326 Incorrect Use of @Once in the V2 Scenario

Error Message
When a variable decorated with '@Once', it must also be decorated with '@Param'.

Description
This error code is reported when the @Once decorator is used without the @Param decorator in the V2 scenario.

Possible Cause
The variable decorated with @Once is not decorated with @Param in the V2 scenario.

Solution
Use @Once together with @Param.

10905327 Failed to Verify the Default Value of @Param in the V2 Scenario

Error Message
When a variable decorated with '@Param' is not assigned a default value, it must also be decorated with '@Require'.

Description
This error code is reported when a variable decorated with @Param in a V2 component is not assigned a default value and is not decorated with @Require.

Possible Cause
In the V2 scenario, the @Param decorator is used to decorate variables that are not assigned default values or decorated with the @Require decorator.

Solution
Assign a default value to the variable decorated with @Param or decorate it with @Require.

10905107 @BuilderParam Initialization Error

Error Message
'@BuilderParam' property can only be initialized by '@Builder' function.

Description
This error code is reported when @BuilderParam decorated variables are initialized using methods other than those decorated with @Builder.

Possible Cause
Other types of variables or regular functions are used to initialize variables decorated with @BuilderParam.

Solution
Change the initial value of @BuilderParam to a function decorated with @Builder.

10905328 Failed to Verify the Member Type of a State Variable

Error Message
The property 'xxx' must specify a type.

Description
This error code is reported when the member property type of a state variable fails verification.

Possible Cause
The type of the state variable is not declared.

Solution
Declare the type for the state variable. The type must meet the verification requirements.

10906217 Failed to verify Service Widget Parameters

Error Message
'@Entry' doesn't support {} parameter in card.

Description
This error code is reported when @Entry in the service widget does not support the specified input parameter.

Possible Cause
An invalid parameter is passed to @Entry in the service widget.

Solution
Rectify the issue based on the error message.

10905108 @Extend Decorator Parameter Verification Error

Error Message
'xxx' should have one and only one parameter.

Description
This error code is reported when decorators such as @Extend do not have exactly one parameter.

Possible Cause
When using decorators such as @Extend, no parameter is provided or multiple parameters are provided.

Solution
Make sure decorators such as @Extend have exactly one parameter.

10903329 Resource Name Verification Exception

Error Message
Unknown resource name 'xxx'.

Description
This error code is reported when the resource name fails verification.

Possible Cause
The provided resource name is incorrect.

Solution
Make sure the resource name is correct.

10903330 Resource Type Verification Exception

Error Message
Unknown resource type 'xxx'.

Description
This error code is reported when the resource type fails verification.

Possible Cause
The provided resource type is incorrect.

Solution
Make sure the resource type is correct.

10903331 Resource Source Verification Exception

Error Message
Unknown resource source 'xxx'.

Description
This error code is reported when the resource source fails verification.

Possible Cause
The provided resource source is incorrect.

Solution
Make sure the resource source is correct.

10905332 Resource Reference Format Verification Exception

Error Message
Invalid resource file parameter. Enter a value in the format of 'xxx.yyy.zzz'.

Description
This error code is reported when the resource is incorrectly referenced.

Possible Cause
The format used to reference resources is incorrect.

Solution
Make sure the format used to reference resources is correct.

10904333 Resource Verification Exception

Error Message
No such 'xxx' resource in current module.

Description
This error code is reported when the $rawfile() references a resource that does not exist.

Possible Cause
The provided resource does not exist.

Solution
Make sure the resource name and path used match those specified using $rawfile.

10905109 wrapBuilder Parameter Verification Exception

Error Message
The wrapBuilder's parameter should be a '@Builder' function.

Description
This error code is reported when the parameter of wrapBuilder is not a global function decorated with @Builder.

Possible Cause
The parameter of wrapBuilder is not an @Builder decorated function.

Solution
Change the parameter of wrapBuilder to a global function decorated with @Builder.

10905110 @Styles Verification Exception

Error Message
'@Styles' decorated functions and methods cannot have arguments.

Description
This error code is reported when the method decorated with the @Styles decorator contains parameters.

Possible Cause
The method decorated with the @Styles decorator contains parameters.

Solution
Remove the parameters from the @Styles decorated method.

10905111 Incorrect Mixed Use of @AnimatedExtend and @Extend

Error Message
The function can not be decorated by '@Extend' and '@AnimatedExtend' at the same time.

Description
This error code is reported when both @AnimatedExtend and @Extend decorators are used to decorate the same API.

Possible Cause
Both the @AnimatedExtend and @Extend decorators are used to decorate the same API.

Solution
Remove either the @Extend or @AnimatedExtend decorator.

10905112 Decorator Verification Error

Error Message
'xxx' can not decorate the method.

Description
This error code is reported when invalid decorators such as @State are used to decorate methods.

Possible Cause
Property decorators such as @State are used to decorate methods.

Solution
Do not use property decorators such as @State to decorate methods.

10905219 Incorrect Use of Child Components

Error Message
The component 'xxx' can only have the child component 'yyy'.

Description
This error code is reported when unsupported child components are used in components such as ContainerSpan.

Possible Cause
A component such as ContainerSpan is used incorrectly with a child component outside the supported range.

Solution
Change the child component to one within the specified range.

10905220 Incorrect Number of Child Components

Error Message
The 'xxx' component can have only one child component.

Description
This error code is reported when components such as Button that allows only a single child component contains multiple child components.

Possible Cause
Multiple child components are defined in a component that allows only a single child component.

Solution
Make sure the component in question has only one child component.

10905221 Incorrect Number of Child Components of a Specific Component

Error Message
When the component 'xxx' set 'yyy' as 'zzz', it can only have a single child component.

Description
This error code is reported when multiple child components are defined for a specific component attribute that allows only a single child component.

Possible Cause
Multiple child components are defined for a specific component attribute that allows only a single child component.

Solution
Delete redundant child components of the specific component. Retain a maximum of one child component.

10905222 Failed to Verify Components Such as Image

Error Message
The component 'xxx' can't have any child.

Description
This error code is reported when components such as Image contain braces (child components).

Possible Cause
Child components are defined for components that do not allow child components, such as Image.

Solution
Delete the child components.

10905223 Incorrect Number of Child Components of a Specific Component

Error Message
When the component 'xxx' set 'yyy' as 'zzz', it can't have any child.

Description
This error code is reported when child components are defined for the target component attribute that does not allow child components.

Possible Cause
Child components are defined for the target component attribute that does not allow child components.

Solution
Delete the child components from the target component.

10905113 Incorrect Use of @Extend

Error Message
Use the 'xxx' decorator only in the global scope.

Description
This error code is reported when decorators such as @Extend is used to decorate a member property method of a class or struct.

Possible Cause
A decorator such as @Extend is used in a class or struct.

Solution
Follow the usage guidelines of decorators.

10905337 Incorrect Decorator Use

Error Message
The 'xxx' decorator can only be used with 'struct'.

Description
This error code is reported when a struct decorator is used to decorate non-structs.

Possible Cause
Struct decorators such as @Component and @ComponentV2 are used to decorate non-structs, such as functions.

Solution
Use the correct decorator based on the error message.

10905338 V2 Decorator Verification Error

Error Message
The 'xxx' decorator can only be used in a 'struct' decorated with '@ComponentV2'.

Description
This error code is reported when a V2 member decorator is used in a struct not decorated with @ComponentV2.

Possible Cause
The V2 member decorator is used in a struct decorated with @Component.

Solution
Apply the V2 member decorator according to the instructions provided in the error message.

10905339 V1 Decorator Verification Error

Error Message
The 'xxx' decorator can only be used in a 'struct' decorated with '@Component'.

Description
This error code is reported when the member decorator of V1 is used in a struct not decorated with @Component.

Possible Cause
The V1 member decorator is used in a struct decorated with @ComponentV2.

Solution
Apply the V1 member decorator according to the instructions provided in the error message.

10905224 An @Observed Decorated Class Cannot Inherit from an @ObservedV2 Decorated Class

Error Message
A class decorated by '@Observed' cannot inherit from a class decorated by '@ObservedV2'.

Description
This error code is reported when an @Observed decorated class inherits from an @ObservedV2 decorated class.

Possible Cause
An @Observed decorated class inherits from an @ObservedV2 decorated class.

Solution
Inherit from a class decorated with @Observed or change the class decorator to @ObservedV2.

10905225 An @ObservedV2 Decorated Class Cannot Inherit from an @Observed Decorated Class

Error Message
A class decorated by '@ObservedV2' cannot inherit from a class decorated by '@Observed'.

Description
This error code is reported when an @ObservedV2 decorated class inherits from an @Observed decorated class.

Possible Cause
An @ObservedV2 decorated class inherits from an @Observed decorated class.

Solution
Inherit from a class decorated with @ObservedV2 or change the class decorator to @Observed.

10905226 Incorrect Mixed Use of @Observed and @ObservedV2

Error Message
A class can not be decorated by '@Observed' and '@ObservedV2' at the same time.

Description
This error code is reported when a class is decorated with both @Observed and @ObservedV2.

Possible Cause
Both @Observed and @ObservedV2 are used to decorate the same class.

Solution
Retain only one appropriate class decorator.

10905340 Incorrect Use of Decorators Designed to Decorate Member Variables in a Class

Error Message
The 'xxx' can decorate only member variables in a 'class'.

Description
This error code is reported when decorators designed to decorate member variables in a class are used to decorate methods instead.

Possible Cause
Decorators designed to decorate member variables in a class, such as @Type, are used to decorate methods instead.

Solution
Remove the decorators in question from methods in the class.

10905341 Incorrect Mixed Use of @Type and @Observed

Error Message
The 'xxx' decorator can not be used in a 'class' decorated with '@Observed'.

Description
This error code is reported when the decorator used in an @Observed decorated class is not supported.

Possible Cause
The decorator used in an @Observed decorated class is not supported.

Solution
Remove the unsupported decorator.

10905342 Incorrect Mixed Use of @Type and @Sendable

Error Message
The 'xxx' decorator can not be used in a 'class' decorated with '@Sendable'.

Description
This error code is reported when the decorator used in an @Sendable decorated class is not supported.

Possible Cause
The decorator used in an @Sendable decorated class is not supported.

Solution
Remove the unsupported decorator.

10905343 Incorrect Use of Decorators Designed to Decorate Member Methods in an @ObservedV2 Decorated Class

Error Message
The 'xxx' can decorate only member 'yyy' within a 'class' decorated with '@ObservedV2'.

Description
This error code is reported when decorators designed to decorate member methods in an @ObservedV2 decorated class are used to decorate member methods in classes decorated with @Observed.

Possible Cause
Decorators designed to decorate member methods in an @ObservedV2 decorated class are used to decorate member methods in classes decorated with @Observed.

Solution
Use the decorator in question, such as @Monitor, only in @ObservedV2 decorated classes. In @Observed classes, use the @Watch decorator instead.

10905344 Incorrect Use of @Track and a V2 Decorator

Error Message
'xxx' cannot be used with classes decorated by '@ObservedV2'. Use the '@Trace' decorator instead.

Description
This error code is reported when a decorator designed for V1 is used with an @ObservedV2 decorated class.

Possible Cause
A decorator designed for V1, such as @Track, is used with an @ObservedV2 decorated class.

Solution
Do not use decorators designed for V1 in @ObservedV2 decorated classes.

10905345 Incorrect Use of @Track Outside a Class

Error Message
The 'xxx' decorator can decorate only member variables of a class.

Description
This error code is reported when a decorator designed for use within a class is applied outside of a class.

Possible Cause
A decorator designed for use within a class, such as @Track, are applied outside of a class.

Solution
Make sure the decorators designed for use within a class are applied only within a class.

10905346 Incorrect Use of a V2 Decorator

Error Message
'xxx' can only decorate member property.

Description
This error code is reported when decorators such as @Local, @Param, @Once, @Event, @Provider, @Consume, and @BuilderParam are used to decorate non-member properties in @ComponentV2.

Possible Cause
The @Local, @Param, @Once, @Event, @Provider, @Consume, or @BuilderParam decorator is used to decorate a non-member property in @ComponentV2.

Solution
Use @Local, @Param, @Once, @Event, @Provider, @Consume, and @BuilderParam only to decorate member properties in @ComponentV2.

10905115 Incorrect Use of Method Decorators

Error Message
'xxx' can only decorate method.

Description
This error code is reported when method decorators, such as @LocalBuilder and @Monitor, are used to decorate non-methods.

Possible Cause
Method decorators, such as @LocalBuilder and @Monitor, are used to decorate property variables, global functions, or methods in classes.

Solution
Use the method decorators only to decorate methods.

10905116 Incorrect Use of the @Computed Decorator

Error Message
'@Computed' can only decorate 'GetAccessor'.

Description
This error code is reported when @Computed is used to decorate a method that is not a getter.

Possible Cause
The @Computed decorator is used to decorate a non-getter method.

Solution
Use @Computed only to decorate getter methods.

10905117 Incorrect Mixed Use of Method Decorators

Error Message
A function can only be decorated with one of the '@AnimatedExtend', '@Builder', '@Extend', '@Styles', '@Concurrent' and '@Sendable''.

Description
This error code is reported when two different method decorators are defined on the same method.

Possible Cause
Multiple method decorators are defined on the same method.

Solution
Select a single appropriate method decorator to use.

10905119 Duplicate Decorators

Error Message
Duplicate 'xxx' decorators for method are not allowed.

Description
This error code is reported when the same decorator is applied to the same method multiple times.

Possible Cause
The same decorator is used repeatedly for a method.

Solution
Avoid using the same decorator multiple times on the same method.

10905121 Incorrect Mixed Use of Built-in Decorators

Error Message
The member property or method can not be decorated by multiple built-in decorators.

Description
This error code is reported when multiple built-in decorators are used to decorate the same member property or method.

Possible Cause
Multiple built-in decorators are used on the same member property or method.

Solution
Select a single appropriate built-in decorator to use.

10905348 Invalid State Variable Type

Error Message
The type of the 'xxx' property can not be a class decorated with '@ObservedV2'.

Description
This error code is reported when a class decorated with @ObservedV2 is used as the type of a state variable.

Possible Cause
A class decorated with @ObservedV2 is used as the type of a state variable.

Solution
Avoid using classes decorated with @ObservedV2 as the type for state variables.

10905122 Incorrect Use of the @Concurrent Decorator

Error Message
'@Concurrent' can not be used on 'xxx' function declaration.

Description
This error code is reported when @Concurrent is used to decorate a specific function.

Possible Cause
The @Concurrent decorator is used to decorate a specific function.

Solution
Do not use the @Concurrent decorator on specific functions.

10905123 Incorrect Use of @Concurrent on Methods

Error Message
'@Concurrent' can not be used on method, please use it on function declaration.

Description
This error code is reported when @Concurrent is used to decorate methods.

Possible Cause
The @Concurrent decorator is used to decorate methods.

Solution
Use the @Concurrent decorator only on function declarations, not on methods.

10905227 The Name of a Custom Component Cannot Be the Same as That of a Built-in Component

Error Message
The struct 'xxx' cannot have the same name as the built-in component 'xxx'.

Description
This error code is reported when the name of a custom component matches the name of a built-in component.

Possible Cause
The custom component has the same name as a built-in component.

Solution
Rename the custom component to a name that is different from any built-in component names.

10905228 The Name of a Custom Component Cannot Be the Same as That of a Built-in Component Attribute Method

Error Message
The struct 'xxx' cannot have the same name as the built-in attribute 'xxx'.

Description
This error code is reported when the name of a custom component matches the name of a built-in component attribute method.

Possible Cause
The custom component has the same name as an attribute method of a built-in component.

Solution
Rename the custom component to a name that is different from any built-in component attribute method names.

10905229 Invalid Struct Decorator

Error Message
The struct 'xxx' can not be decorated with '@ComponentV2' and '@Component', '@Reusable', '@CustomDialog' at the same time.

Description
This error code is reported when a struct is decorated with multiple incompatible decorators such as @ComponentV2, @Component, @Reusable, and @CustomDialog.

Possible Cause
Multiple decorators that are not compatible with each other are used on the same struct.

Solution
Avoid using incompatible decorators on the same struct. Use only one appropriate decorator for the struct.

10905230 Lack of Required Decorators for Child Components

Error Message
Decorator '@Component', '@ComponentV2', or '@CustomDialog' is missing for struct 'xxx'.

Description
This error code is reported when a child component is not decorated with @Component, @ComponentV2, or @CustomDialog.

Possible Cause
The child component is not decorated with @Component, @ComponentV2, or @CustomDialog.

Solution
Make sure the child component is decorated with @Component, @ComponentV2, or @CustomDialog.

10905402 Invalid Use of the @Entry Decorator

Error Message
A page configured in 'main_pages.json' or 'build-profile.json5' must have one and only one '@Entry' decorator.

Description
This error code is reported when the @Entry decorator is missing or incorrectly used on the home page.

Possible Cause
The home page is not decorated with the @Entry decorator.

Solution
Make sure the home page has exactly one @Entry decorator.

10905231 Invalid Number of the @Entry Decorators

Error Message
A page can't contain more than one '@Entry' decorator.

Description
This error code is reported when multiple @Entry decorators are used on a single page.

Possible Cause
Multiple @Entry decorators are used on a single page.

Solution
Remove unnecessary @Entry decorators, making sure only one @Entry decorator is used on a page.

10905404 Invalid Number of the @Preview Decorators

Error Message
A page can contain at most 10 '@Preview' decorators.

Description
This error code is reported when more than 10 @Preview decorators are used on a single page.

Possible Cause
More than 10 @Preview decorators are used on the same page.

Solution
Remove unnecessary @Preview decorators, making sure a maximum of 10 @Preview decorators are used on a page.

10905232 Invalid Struct Name

Error Message
A struct must have a name.

Description
This error code is reported when a struct is not named.

Possible Cause
No name is provided for the struct.

Solution
Define a name for the struct.

10905233 Lack of Required Decorators for Child Components

Error Message
Decorator '@Component', '@ComponentV2', or '@CustomDialog' is missing for struct 'xxx'.

Description
This error code is reported when a child component is not decorated with @Component, @ComponentV2, or @CustomDialog and is called by the parent component.

Possible Cause
The child component is not decorated with @Component, @ComponentV2, or @CustomDialog.

Solution
Make sure the child component is decorated with @Component, @ComponentV2, or @CustomDialog before calling it.

10905125 Incorrect Use of Multiple Decorators on the Same Member Property or Method

Error Message
The member property or method can not be decorated by multiple decorators.

Description
This error code is reported when multiple decorators are used on the same member property or method.

Possible Cause
Multiple decorators are used on the same member property or method.

Solution
Remove redundant decorators and retain only one appropriate decorator.

10905235 Invalid Component Name

Error Message
The module name 'xxx' can not be the same as the inner component name.

Description
This error code is reported when the name of a custom component matches the name of a built-in component.

Possible Cause
The custom component has the same name as a built-in component.

Solution
Change the name of the custom component to a name that is different from any built-in component names.

10905236 Incorrect Component Use

Error Message
UI component 'xxx' cannot be used in this place.

Description
This error code is reported when the ArkUI built-in component is used outside the allowed context, such as outside the @Builder or build() method.

Possible Cause
The built-in component is used outside the @Builder or build() method, which does not meet the usage restrictions.

Solution
Use the built-in component within the @Builder method, build() method, or page transition method.

10905237 Invalid Component Name

Error Message
The struct name cannot contain reserved tag name: 'xxx'.

Description
This error code is reported when the name of a custom component matches the name of an existing component.

Possible Cause
The custom component has the same name as an existing component.

Solution
Change the name of the custom component to a valid component name that is different from the existing component name.

10905127 Invalid @Styles Declaration

Error Message
Should not add return type to the function that is decorated by Styles.

Description
This error code is reported when functions decorated with @Styles return function types.

Possible Cause
The return value of the function decorated with @Styles is of the function type.

Solution
Do not declare the return value of a function decorated with @Styles as a function type.

10905238 Invalid Struct Declaration

Error Message
A struct declaration without the 'default' modifier must have a name.

Description
This error code is reported when a struct declaration without the default modifier is not named.

Possible Cause
The struct is declared without the default modifier and is not named.

Solution
Name the struct correctly.

10905128 Invalid @Extend Declaration

Error Message
Should not add return type to the function that is decorated by Extend.

Description
This error code is reported when functions decorated with @Extend return function types.

Possible Cause
The return value of the function decorated with @Extend is of the function type.

Solution
Do not declare the return value of a function decorated with @Extend as a function type.

10905129 Incorrect Mixed Use of @Computed and !!

Error Message
A property decorated by 'xxx' cannot be used with two-bind syntax.

Description
This error code is reported when the @Computed decorator is incorrectly used with two-way binding syntax.

Possible Cause
The @Computed decorator and two-way binding syntax are used together.

Solution
Do not use the @Computed decorator and two-way binding syntax together.

10905130 Incorrect Use of @Computed on a Setter Method

Error Message
A property decorated by 'xxx' cannot define a set method.

Description
This error code is reported when the @Computed decorator is used on a setter method.

Possible Cause
The setter method is decorated using the @Computed decorator.

Solution
Use the @Computed decorator only on a getter method.

10905358 !! Syntax Error

Error Message
When the two-way binding syntax is used, do not assign a value to 'xxx' variable 'yyy' because the framework generates the default assignment.

Description
This error code is reported when a value is assigned to the variable in an @Event decorated method while two-way binding syntax is used.

Possible Cause
Two-way binding syntax is used and a value is passed to the @Event method.

Solution
When using two-way binding syntax, do not pass values to the @Event method. The ArkUI framework will handle the default assignment.

10905241 Incorrect Mixed Use of @Reusable and @ReusableV2

Error Message
The '@Reusable' and '@ReusableV2' decorators cannot be applied simultaneously.

Description
This error code is reported when @Reusable and @ReusableV2 are used together.

Possible Cause
Both @Reusable and @ReusableV2 are used to decorate a component.

Solution
Do not use @Reusable and @ReusableV2 together. Choose one appropriate decorator.

10905242 Incorrect Use of @ReusableV2

Error Message
'@ReusableV2' is only applicable to custom components decorated by '@ComponentV2'.

Description
This error code is reported when @ReusableV2 is used to decorate custom components that are not decorated with @ComponentV2.

Possible Cause
The @ReusableV2 decorator is used to decorate components that are not decorated with @ComponentV2.

Solution
Use @ReusableV2 only with custom components decorated with @ComponentV2.

10905244 Incorrect Use of @ReusableV2

Error Message
A custom component decorated with '@Component' cannot contain child components decorated with '@ReusableV2'.

Description
This error code is reported when components decorated with @Component contain child components decorated with @ReusableV2.

Possible Cause
A component decorated with @Component calls a child component decorated with @ReusableV2.

Solution
Do not call components decorated with @ReusableV2 within components decorated with @Component.

10905245 Incorrect Use of @ReusableV2

Error Message
A custom component decorated with '@Reusable' cannot contain any child components decorated with '@ReusableV2'.

Description
This error code is reported when components decorated with @Reusable contain child components decorated with @ReusableV2.

Possible Cause
A component decorated with @Reusable calls a child component decorated with @ReusableV2.

Solution
Do not call components decorated with @ReusableV2 within components decorated with @Reusable.

10905246 Incorrect Use of @Reusable

Error Message
A custom component decorated with '@ReusableV2' cannot contain child components decorated with '@Reusable'.

Description
This error code is reported when components decorated with @ReusableV2 contain child components decorated with @Reusable.

Possible Cause
A component decorated with @ReusableV2 calls a child component decorated with @Reusable.

Solution
Do not call components decorated with @Reusable within components decorated with @ReusableV2.

10905359 Component Initialization Error

Error Message
Property 'xxx' must be initialized through the component constructor.

Description
This error code is reported when the variable decorated with @Require is not initialized during parent component construction.

Possible Cause
The variable decorated with @Require is not initialized during parent component construction.

Solution
Initialize variables decorated with @Require when constructing the parent component.

10905247 Incorrect Use of @ReusableV2

Error Message
The template attribute of the Repeat component cannot contain any custom component decorated with '@ReusableV2'.

Description
This error code is reported when Repeat.template contains custom components decorated with @ReusableV2.

Possible Cause
The template property of Repeat contains a custom component decorated with @ReusableV2.

Solution
Remove the component decorated with @ReusableV2 from the template property.

10905248 Incorrect Use of the reuse Attribute

Error Message
The reuse attribute is only applicable to custom components decorated with both '@ComponentV2' and '@ReusableV2'.

Description
This error code is reported when the reuse attribute is incorrectly applied to components that are not properly decorated for reuse functionality.

Possible Cause
The reuse attribute is not used with custom components that are decorated with both @ComponentV2 and @ReusableV2.

Solution
Use the reuse attribute only for custom components decorated with both @ComponentV2 and @ReusableV2.

10905249 Incorrect Use of the reuseId Attribute

Error Message
The reuseId attribute is not applicable to custom components decorated with both '@ComponentV2' and '@ReusableV2'.

Description
This error code is reported when reuseId is used for custom components decorated with @ComponentV2 and @ReusableV2.

Possible Cause
reuseId is used for custom components decorated with @ComponentV2 and @ReusableV2.

Solution
Use the reuseId attribute in the correct scenario.

10905363 V1 Decorator Cannot Decorate Variables of the Function or () => void Type

Error Message
The V1 decorator 'xxx' cannot be applied to a Function-type variable 'yyy'.

Description
This error code is reported at runtime when the ArkUI state management V1 decorator is used for variables of the Function or () => void type. Since API version 23, this issue is intercepted in the compilation phase to avoid potential runtime exceptions. The ArkUI state management V1 decorators include @State, @Prop, @Link, @Provide, @Consume, @StorageLink, @StorageProp, @LocalStorageLink, @LocalStorageProp, @ObjectLink.

Possible Cause
The V1 decorator is used for a variable of the Function or () => void type.

Solution
Delete the V1 decorator used for the variable of the Function or () => void type based on the error description.