hi3861编译报错 ERROR Unresolved dependencies 未解决的依赖

hi3861编译报错 ERROR Unresolved dependencies

在这里插入图片描述
在错误日志/home/openharmony/out/hispark_pegasus/wifiiot_hispark_pegasus/build.log中能看到,是工具链不匹配造成的依赖缺失。
需要进行如下图的四步操作:
在这里插入图片描述
把工具链切换成wifiiot_hispark_pegasus@hisilicon并保持,如果提示未安装则需要先安装再进行保存。
在这里插入图片描述
然后就成功了。

很抱歉,之前的回答有误。根据您提供的信息,这个错误确实与 VS Code 插件开发中的 Webview 缓存有关。 在 VS Code 插件开发中,Webview 缓存提供了一种缓存资源以提高性能的方式。但是,如果在 Webview 缓存的代码中使用了 `caches` 变量,但该变量并没有被定义或声明,就会出现 `ReferenceError: caches is not defined` 错误。 解决这个问题的方法是,在 Webview 缓存的代码中确保正确引入了 `vscode` 模块,并在 `activate` 函数中调用 `vscode.workspace.registerFileSystemProvider` 方法注册一个文件系统提供程序。这样,在 Webview 缓存的代码中就可以使用 `caches` 变量来缓存资源了。 下面是一个示例代码: ```typescript import * as vscode from 'vscode'; export function activate(context: vscode.ExtensionContext) { // 注册文件系统提供程序 vscode.workspace.registerFileSystemProvider('my-fs', { async readFile(uri: vscode.Uri): Promise<Uint8Array> { // 读取文件的实现 }, async writeFile(uri: vscode.Uri, content: Uint8Array, options: vscode.WriteFileOptions): Promise<void> { // 写入文件的实现 }, async delete(uri: vscode.Uri, options: vscode.FileDeleteOptions): Promise<void> { // 删除文件的实现 }, async rename(oldUri: vscode.Uri, newUri: vscode.Uri, options: vscode.FileRenameOptions): Promise<void> { // 重命名文件的实现 }, }); // 在 Webview 缓存的代码中使用 caches 变量 const webView = vscode.window.createWebviewPanel( 'myWebView', 'My Webview', vscode.ViewColumn.One, { enableScripts: true, } ); webView.webview.html = ` <html> <head> <script> const cacheName = 'myCache'; const cacheVersion = 'v1'; const cacheKey = new URL(location.href).toString(); const cache = await caches.open(cacheName); // 使用 caches 变量缓存资源 await cache.add(new Request(cacheKey)); </script> </head> <body> <h1>Hello, World!</h1> </body> </html> `; } ``` 希望这个回答能够帮助到您。如果还有其他问题,请随时问我。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

灵芝三昧

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值