HarmonyOS 报错Can not found module.json5?

Parse ohos module.json5 error: Exception: Can not found module.json5

错误日志:(对应的目录下,我看到有module.json5 )

Parse ohos module.json5 error: Exception: Can not found module.json5 at C:/Users/xxx/AppData/Local/Pub/Cache/git/flutter\_packages-706831c56844169808e61e99b99238af8caa1fcc/packages/shared\_preferences/shared\_preferences\_ohos/ohos\src\main\module.json5 .

You need to update the Flutter plugin project structure.

See https://gitee.com/openharmony...\_samples/tree/master/ohos/docs/09\_specifications/update\_flutter\_plugin\_structure.md

阅读 628
1 个回答

1.确认pub cache路径,windows默认路径过长,将cache路径可修改为D:\cache\pub,Cache与cache大小写不一致可能导致识别不到路劲。

2.确认项目与pub cache目录在同一磁盘下。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进