HarmonyOS 鸿蒙Next webview_flutter_ohos编译报错
HarmonyOS 鸿蒙Next webview_flutter_ohos编译报错
近期从git上拉下最新的webview_flutter包,发现编译报错,和以前的webview_flutter对比发现,是packages/webview_flutter/webview_flutter_ohos/ohos/webview_flutter缺少了libs文件夹,如果加上这个文件夹,就可以正常编译,不会报错。
是否有问题,这个libs文件目前使用以前的老版本webview_flutter中的libs文件夹,可正常编译,这样是否可靠? url: “https://gitee.com/openharmony-sig/flutter_packages.git” path: “packages/webview_flutter/webview_flutter_ohos” ohpm ERROR: EFETCH Fetch local file package error, ht_web/webview_flutter_ohos/ohos/webview_flutter/libs/flutter.har does not exist. ohpm ERROR: missing: @ohos/flutter_ohos@/Users/lxx/ohos/htsec/ht_web/webview_flutter_ohos/ohos/webview_flutter/libs/flutter.har, required by webview_flutter@1.0.0
更多关于HarmonyOS 鸿蒙Next webview_flutter_ohos编译报错的实战系列教程也可以访问 https://www.itying.com/category-92-b0.html
创建完flutter工程后,是否使用引擎编译过
flutter build hap --local-engine=F:\flutterEngine\engine-windows\20231226\src\out\ohos_debug_unopt_arm64 --debug
这种情况是之前的git依赖方式的缓存导致的,请修改 pubspec.yaml
后再重新编译一下。
修改 pubspec.yaml
dependencies:
flutter:
sdk: flutter
webview_flutter_ohos:
git:
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: packages/webview_flutter/webview_flutter_ohos
拉取依赖 flutter pug get
还原 pubspec.yaml
dependencies:
flutter:
sdk: flutter
webview_flutter:
git:
url: https://gitee.com/openharmony-sig/flutter_packages.git
path: packages/webview_flutter/webview_flutter
拉取依赖 flutter pug get
重新编译
flutter build hap --local-engine=/Users/xxx/ohos/src/out/ohos_debug_unopt_arm64 --debug
参考链接:https://gitee.com/openharmony-sig/flutter_packages/pulls/112
更多关于HarmonyOS 鸿蒙Next webview_flutter_ohos编译报错的实战系列教程也可以访问 https://www.itying.com/category-92-b0.html