harmonyOS next 读取RawFile资源文件夹下的文件一直报错

try {  getContext(this).resourceManager.getRawFileContent("MapData.json", (error: BusinessError, value: Uint8Array) => {    const textDecoder = util.TextDecoder.create("utf-8");    const res = textDecoder.decodeWithStream(value, { stream: false });    this.sections = JSON.parse(res);  });} catch (error) {  console.error(`callback getRawFileContent failed, error is ${JSON.stringify(error)}`)}

捕获错误  callback getRawFileContent failed, error is {}

从学堂直接拉取的代码



#harmonyOS next
getRawFileConten
2024-08-04 15:11:15
浏览
收藏 0
回答 0
待解决
相关问题
HarmonyOS 如何获取assets文件夹下文件
1310浏览 • 1回复 待解决
HarmonyOS 如何读取Module中资源文件
1109浏览 • 1回复 待解决
自定义资源文件怎么读取
3368浏览 • 1回复 待解决
HarmonyOS Rawfilejson文件读取
1225浏览 • 1回复 待解决
HarmonyOS 如何解压gzip到某个文件夹下
964浏览 • 1回复 待解决
HarmonyOS 读取本地RawFile文件失败
1930浏览 • 1回复 待解决
如何获取HSP资源文件
3355浏览 • 1回复 待解决
Preview是否支持读取rawfile文件
3885浏览 • 1回复 待解决
HarmonyOS rawFile文件夹合并问题
1201浏览 • 1回复 待解决