HarmonyOS 鸿蒙Next Flutter项目转鸿蒙项目时DevEco Studio报错怎么处理

发布于 1周前 作者 h691938207 来自 鸿蒙OS

HarmonyOS 鸿蒙Next Flutter项目转鸿蒙项目时DevEco Studio报错怎么处理

我在Flutter项目的yaml文件中引用的库如下

cupertino_icons: ^1.0.2
dio: ^4.0.1  #全flutter 不用鸿蒙版
shared_preferences:
git:
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: “packages/shared_preferences/shared_preferences”
fluttertoast:
git:
url: https://gitee.com/openharmony-sig/flutter_fluttertoast.git
package_info_plus:
git:
url: https://gitee.com/openharmony-sig/flutter_plus_plugins.git
path: “packages/package_info_plus/package_info_plus”
image_picker:  #照片选择器
git:
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: “packages/image_picker/image_picker”
webview_flutter:  #webview
git:
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: “packages/webview_flutter/webview_flutter”
scan:  #扫描二维码
git:
url: https://gitee.com/openharmony-sig/fluttertpc_scan.git
permission_handler:  #设备权限
git:
url: https://gitee.com/openharmony-sig/flutter_permission_handler.git
path: “permission_handler”
path_provider:  #配合图片压缩使用
git:
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: “packages/path_provider/path_provider”
image_gallery_saver:   #文件保存插件
git:
url: https://gitee.com/openharmony-sig/flutter_image_gallery_saver.git
url_launcher:  #吊起系统功能app 例如浏览器、短信、homeInfoModel打电话等
git :
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: “packages/url_launcher/url_launcher”
flutter_sound:
git:
url: https://gitee.com/openharmony-sig/flutter_sound.git
path: “flutter_sound”
audio_session:  #音频处理硬件
git:
url: https://gitee.com/openharmony-sig/flutter_audio_session.git
device_info_plus:
git:
url: https://gitee.com/openharmony-sig/flutter_plus_plugins.git
path: “packages/device_info_plus/device_info_plus”

““D:\DevEco Studio\tools\ohpm\bin\ohpm.bat”” install --all --registry https://repo.harmonyos.com/ohpm/

ohpm INFO: MetaDataFetcher fetching meta info of package ‘@ohos/hypium’ from https://repo.harmonyos.com/ohpm/

ohpm ERROR: Found exception: Error: The source code dependency “audio_session@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\flutter_audio_session-61f36876d9c9eb5ee764a32ad5804afea0c85512\ohos” is not in the same file system as the current project, reached retry limit or non retryable error encountered.

ohpm ERROR: ERUNNING execute tasks failed, Error: The source code dependency “audio_session@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\flutter_audio_session-61f36876d9c9eb5ee764a32ad5804afea0c85512\ohos” is not in the same file system as the current project

ohpm ERROR: Found exception: Error: The source code dependency “fluttertoast@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\flutter_fluttertoast-8741858c5115de90df799964e5d041c8cde5a835\ohos” is not in the same file system as the current project, reached retry limit or non retryable error encountered.

ohpm ERROR: Found exception: Error: The source code dependency “image_gallery_saver@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\flutter_image_gallery_saver-b990604be3f945285e399f2d6e76922c6927df2c\ohos” is not in the same file system as the current project, reached retry limit or non retryable error encountered.

ohpm ERROR: Found exception: Error: The source code dependency “permission_handler_ohos@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\flutter_permission_handler-33f9cf41cd66fe36af0db69c36fb7dd9eb3b1456\permission_handler_ohos\ohos” is not in the same file system as the current project, reached retry limit or non retryable error encountered.

ohpm ERROR: Found exception: Error: The source code dependency “flutter_sound@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\flutter_sound-c4f7c76d340849ceae42668a6e36b8aba7c07d29\flutter_sound\ohos” is not in the same file system as the current project, reached retry limit or non retryable error encountered.

ohpm ERROR: Found exception: Error: The source code dependency “scan@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\fluttertpc_scan-c26b30b83616b0c33418137fea70fae2bef9a79d\ohos” is not in the same file system as the current project, reached retry limit or non retryable error encountered.

ohpm ERROR: Install failed, detail: Error: The source code dependency “audio_session@C:\Users\Administrator\fvm\versions\3.7.12-ohos-1.0.2\bin\cache\git\flutter_audio_session-61f36876d9c9eb5ee764a32ad5804afea0c85512\ohos” is not in the same file system as the current project

Process finished with exit code 1

cke_474.png

5 回复
cke_123.png环境变量加这个试试

发现问题原因了 我是windows系统 所以要转成鸿蒙的项目得和flutter的sdk在一个盘符下面 才不报错

但是发现了个新问题。。。。run按钮不亮了

针对HarmonyOS 鸿蒙Next Flutter项目转鸿蒙项目时DevEco Studio报错的问题,以下是一些专业的处理步骤:

  1. 确认设备识别:确保DevEco Studio正确识别鸿蒙设备。在IDE的设备管理器中查看设备状态,确保设备已被识别为HarmonyOS设备。
  2. 修改配置文件:检查项目中的build-profile.json5文件,将runtimeOS字段修改为HarmonyOS,以匹配当前设备的操作系统。
  3. 更新开发工具:确保DevEco Studio和HarmonyOS SDK均为最新版本,以兼容最新的鸿蒙系统特性。
  4. 检查Java版本:确保计算机上已安装符合要求的Java开发工具包(JDK),DevEco Studio通常需要Java 8或更高版本。
  5. 重启IDE:有时重启DevEco Studio可以解决一些识别或配置问题。
  6. 重新连接设备:断开设备连接,重新启用USB调试模式,并重新连接设备,以确保设备连接稳定。

如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html

回到顶部