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 如何读取Module中资源文件
1084浏览 • 1回复 待解决
HarmonyOS 如何获取assets文件夹下文件
1258浏览 • 1回复 待解决
自定义资源文件怎么读取
3323浏览 • 1回复 待解决
HarmonyOS Rawfilejson文件读取
1211浏览 • 1回复 待解决
HarmonyOS 读取本地RawFile文件失败
1860浏览 • 1回复 待解决
HarmonyOS 如何解压gzip到某个文件夹下
949浏览 • 1回复 待解决
HarmonyOS rawFile文件夹合并问题
1189浏览 • 1回复 待解决
如何获取HSP资源文件
3340浏览 • 1回复 待解决
HarmonyOS 终端运行ohpm一直报错
1369浏览 • 1回复 待解决