仓颉开发HarmonyOS报错error: undeclared identifier '__GenerateResource__'

> hvigor ERROR: Failed :entry:default@CompileCangjie... 
> hvigor ERROR: Tools execution failed.
error: undeclared identifier '__GenerateResource__'
   | 
   | /* 22.14 */                            thisView.observeComponentCreation({ elmtId, isInitialRender => Image(__GenerateResource__("", "", "", app.media.ic_arrow_down_circle, "app.media.ic_arrow_down_circle",[], 20000)).width(24).height(24).margin(left: 4).align(Alignment.BottomEnd).onClick { evt => FileUtil.downloadFileWithRequest(globalContext, msg.content) } }) }.align(Alignment.BottomEnd) }) }.padding(4).backgroundColor(0xffffff).constraintSize(maxWidth: 90.percent).borderRadius(10) }) }.width(100.percent).padding(4)
   |                                                                                                             ^^^^^^^^^^^^^^^^^^^^ 
   | 
note: the error occurs after the macro is expanded
  ==> D:\workspace\gitee\develop-native-harmonyos-ai-assistant-with-cangjie-video\samples\ch11\CangjieAiAssistant\entry\src\main\cangjie\src\page\chat_line_drawing.cj:22:1:
   | 
22 |   @Builder
   |  _^
23 | | public func ChatLineDrawing(globalContext: AbilityContext, msg: Message) {
   | | ...
48 | | }
   | |_^
   | 
note: the code after the macro is expanded as follows
   | 
   |   /* 22.1 */public func ChatLineDrawing(thisView: CustomView, globalContext: ObservedProperty < AbilityContext >, msg: ObservedProperty < Message >): ViewBuilder {
   |  _^
   | | /* 22.2 */    
   | | /* 22.3 */    
   | | /* 22.4 */    func ChatLineDrawing__inner__(thisView: CustomView, globalContext: AbilityContext, msg: Message): Unit {
   | | /* 22.5 */        
   | | /* 22.6 */        thisView.observeComponentCreation({ elmtId, isInitialRender =>
   | | /* 22.7 */            If {
   | | /* 22.8 */                
   | | /* 22.9 */                if(msg.role == "assistant") {
   | | /* 22.10 */                    thisView.ifElseBranchUpdateFunction(0, { =>
   | | /* 22.11 */                        
   | | /* 22.12 */                        thisView.observeComponentCreation({ elmtId, isInitialRender =>
   | | /* 22.13 */                            Row() { thisView.observeComponentCreation({ elmtId, isInitialRender => Row() { thisView.observeComponentCreation({ elmtId, isInitialRender => Stack() { thisView.observeComponentCreation({ elmtId, isInitialRender => Image(msg.content) })
   | | /* 22.14 */                            thisView.observeComponentCreation({ elmtId, isInitialRender => Image(__GenerateResource__("", "", "", app.media.ic_arrow_down_circle, "app.media.ic_arrow_down_circle",[], 20000)).width(24).height(24).margin(left: 4).align(Alignment.BottomEnd).onClick { evt => FileUtil.downloadFileWithRequest(globalContext, msg.content) } }) }.align(Alignment.BottomEnd) }) }.padding(4).backgroundColor(0xffffff).constraintSize(maxWidth: 90.percent).borderRadius(10) }) }.width(100.percent).padding(4)
   | | /* 22.15 */                        })
   | | /* 22.16 */                        
   | | /* 22.17 */                    })
   | | /* 22.18 */                    
   | | /* 22.19 */                }
   | | /* 22.20 */                else
   | | /* 22.21 */                {
   | | /* 22.22 */                    thisView.ifElseBranchUpdateFunction(1, { =>
   | | /* 22.23 */                        
   | | /* 22.24 */                        thisView.observeComponentCreation({ elmtId, isInitialRender =>
   | | /* 22.25 */                            Row() { thisView.observeComponentCreation({ elmtId, isInitialRender => Row() { thisView.observeComponentCreation({ elmtId, isInitialRender => Text(msg.content).fontSize(20) }) }.padding(4).backgroundColor(0x96ef6b).borderRadius(10).constraintSize(maxWidth: 90.percent) }) }.width(100.percent).padding(4).justifyContent(FlexAlign.End)
   | | /* 22.26 */                        })
   | | /* 22.27 */                        
   | | /* 22.28 */                    })
   | | /* 22.29 */                    
   | | /* 22.30 */                }
   | | /* 22.31 */                
   | | /* 22.32 */            }
   | | /* 22.33 */        })
   | | /* 22.34 */        
   | | /* 22.35 */        
   | | /* 22.36 */    }
   | | /* 22.37 */    
   | | /* 22.38 */    
   | | /* 22.39 */    ViewBuilder { ChatLineDrawing__inner__(thisView, globalContext.get(), msg.get()) }
   | | /* 22.40 */    
   | | /* 22.41 */}
   | | /* 22.42 */
   | |___________^
仓颉
HarmonyOS
2025-03-29 23:29:22
浏览
收藏 0
回答 0
待解决
相关问题
HarmonyOS 可以用仓颉开发HarmonyOS
1250浏览 • 1回复 待解决
仓颉编程语言也能开发手机APP吗?
1579浏览 • 1回复 已解决
冷启动报错Error message
3287浏览 • 1回复 待解决
报错Error while Deploying HAP。
14693浏览 • 2回复 待解决
HarmonyOS identifier.getOAID 获取失败
1555浏览 • 1回复 待解决
可以用仓颉开发鸿蒙应用吗?
701浏览 • 1回复 已解决
HarmonyOS 闪退报错 Error code:2100001
1087浏览 • 1回复 待解决
HarmonyOS 获取identifier.getOAID() 为 0
1786浏览 • 1回复 待解决