错误信息
The target is not a custom component instance or V2 class instance.
错误描述
addMonitor/clearMonitor的目标对象参数不合法。
可能原因
目标对象不满足以下情况:
处理步骤
确保addMonitor/clearMonitor的目标对象合法,详情请参见addMonitor/clearMonitor开发指南。
错误信息
The path is invalid.
错误描述
addMonitor/clearMonitor的路径参数不合法。
可能原因
路径既不是string类型,也不是数组类型。
处理步骤
确保addMonitor/clearMonitor的路径合法,详情请参见addMonitor/clearMonitor开发指南。
错误信息
addMonitor/clearMonitor failed because the monitorFunc is illegal, monitorFunc must be function or but cannot be an anonymous function.
错误描述
addMonitor/clearMonitor的回调方法参数不合法。
可能原因
回调方法不是function类型,或者是匿名function类型。
处理步骤
确保addMonitor/clearMonitor的回调方法合法,详情请参见addMonitor/clearMonitor开发指南。
错误信息
The function is not allowed to be called in @Computed.
错误描述
applySync/flushUpdates/flushUIUpdates接口在@Computed装饰的getter方法内调用是不合法的。
可能原因
applySync/flushUpdates/flushUIUpdates接口在@Computed装饰的getter方法内被调用。@Computed装饰的getter方法用于派生值的计算,在其中调用这些接口会触发额外的状态刷新,破坏计算属性的求值逻辑,具体限制请参见applySync/flushUpdates/flushUIUpdates接口限制条件。
处理步骤
确保在@Computed装饰的getter方法内没有调用applySync/flushUpdates/flushUIUpdates接口。
错误信息
The function is not allowed to be called in @Monitor.
错误描述
flushUpdates/flushUIUpdates接口在@Monitor回调方法内调用是不合法的。
可能原因
flushUpdates/flushUIUpdates接口在@Monitor回调方法内被调用。@Monitor的回调方法在状态变化时被触发,在其中调用这些接口会导致重复的状态刷新,可能引发循环更新,具体限制请参见applySync/flushUpdates/flushUIUpdates接口限制条件。
处理步骤
确保在@Monitor回调方法内没有调用flushUpdates/flushUIUpdates接口。
错误信息
Not supported type! The type should have function constructor signature.
错误描述
使用AppStorageV2的connect或PersistenceV2的connect和globalConnect时,type参数类型不合法。
可能原因
使用AppStorageV2的connect或PersistenceV2的connect和globalConnect时,type参数类型不是TypeConstructorWithArgs<T>类型。
处理步骤
确保connect/globalConnect传入的type为TypeConstructorWithArgs<T>类型,具体支持类型见PersistenceV2使用限制和AppStorageV2使用限制。
错误信息
The default creator should be function when first connect.
错误描述
首次使用AppStorageV2的connect或PersistenceV2的connect和globalConnect时,defaultCreator默认数据的构造器不是StorageDefaultCreator<T>。
可能原因
defaultCreator不是StorageDefaultCreator<T>类型。
处理步骤
确保connect/globalConnect传入的defaultCreator为StorageDefaultCreator<T>类型。以globalConnect为例,示例请参考globalConnect。
错误信息
ERROR, Duplicate key used when connect
错误描述
connect和globalConnect使用相同的key。
可能原因
connect和globalConnect使用了相同的key。
处理步骤
不建议混用connect和globalConnect;如确需混用,请确保这两个接口不使用相同的key。详情请参见PersistenceV2使用限制。
错误信息
AreaMode Value Error! value range can only in EL1-EL5
错误描述
使用PersistenceV2的globalConnect存储数据设置的加密级别不在EL1-EL5范围内。
可能原因
设置globalConnect参数ConnectOptions的areaMode属性范围不在EL1-EL5内。
处理步骤
设置加密级别范围为EL1-EL5,示例请参考使用globalConnect存储数据。
错误信息
The type of target mismatches the type of source.
错误描述
使用AppStorageV2的connect或PersistenceV2的connect和globalConnect时,发生类型不匹配错误。
可能原因
处理步骤
错误信息
Miss @Type.
错误描述
PersistenceV2的globalConnect时,缺少@Type装饰器。
可能原因
使用globalConnect接口持久化数据时,持久化的数据类型缺少@Type装饰器。该错误码通过日志上报,不会抛出运行时异常。
处理步骤
确保globalConnect持久化复杂类型时,用@Type装饰类名。
错误信息
@Builder: Invalid attempt to set(write to) parameter error!
错误描述
在@Builder装饰的函数内部修改入参属性。
可能原因
在@Builder装饰的函数内部修改入参属性,详情见@Builder限制条件。
处理步骤
不在@Builder装饰的函数内部修改入参属性,可使用MutableBinding代替,示例请参考在@Builder装饰的函数内部修改入参内容。
错误信息
Illegal usage of not @Track'ed property on UI!
错误描述
如果类中有一个@Track装饰的属性,则禁止在UI中使用该类中未被@Track装饰的属性。
可能原因
将有@Track装饰类中的未被@Track装饰的属性绑定在UI上,详情见@Track限制条件。
处理步骤
为报错信息中提示的属性添加@Track装饰,示例请参考在UI中使用非@Track装饰的属性发生运行时报错。
错误信息
@Consume missing @Provide property with name or default value. Fail to resolve @Consume.
错误描述
@Consume初始化失败,@Consume没有找到匹配的@Provide数据源,且开发者没有提供@Consume默认值。
可能原因
@Consume寻找@Provide失败,一般有以下两种原因:
处理步骤
错误信息
Old toolchain detected. Please upgrade to the latest.
错误描述
从API version 18开始,支持@Reusable(父组件)中创建@ComponentV2(子组件),但需要开发者使用API version 18及以上SDK,否则会有运行时报错。从API version 23开始,将返回此错误码,详情见@ReusableV2使用限制。
可能原因
从API version 18开始,支持@Reusable(父组件)和@ComponentV2(子组件)混用,开发者使用了API version 18及以上的设备,但没有使用API version 18及以上的SDK版本编译,所以运行时报错,提醒开发者SDK版本过低。
处理步骤
使用API version 18及以上的SDK编译应用。
错误信息
duplicate @Provide property. Property with this name is provided by one of the ancestor Views already.
错误描述
在同一个组件、父组件或其祖先节点中,存在声明了相同的key的@Provide,详情见@Provide限制条件。
可能原因
在同一个组件、父组件或其祖先节点中,存在声明了相同的key的@Provide。
处理步骤
保证在同一个组件,包括其父组件和其祖先节点中,@Provide的key不同。或将相同key设置为可重写,即设置ProvideOptions中的allowOverride参数,示例见@Provide支持allowOverride参数。
错误信息
Illegal variable value error with decorated variable
错误描述
创建状态管理V1状态变量时,使用了不支持的类型。
可能原因
使用V1状态变量装饰器(如@State、@Prop、@Link等)装饰了不支持的类型。
处理步骤
使用状态管理V1的状态变量支持的类型,以@State为例,详情见@State装饰器使用规则说明。
错误信息
The key is invalid, key must be string or TypeConstructorWithArgs type.
错误描述
使用AppStorageV2、PersistenceV2的remove接口和PersistenceV2的save接口传入key不合法。
可能原因
key不是string或TypeConstructorWithArgs<T>类型。
处理步骤
确保调用AppStorageV2、PersistenceV2的remove接口和PersistenceV2的save接口时传入的key参数为string或TypeConstructorWithArgs<T>类型。