HarmonyOS 使用SDK 12编译,同时更新了flutter_flutter最新版本、引擎,但是flutter_webview编译失败

报错:

1 ERROR: ArkTS:ERROR File:
  /Users/xxxxx/.pub-cache/git/ohos_flutter_packages-b615f80433c1724d467e3a63f7861855e8144a99/packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_f
lutter/OhosWebView.ets:17:10
Module '"@ohos/flutter_ohos/src/main/ets/plugin/platform/PlatformView"' has no exported member 'Params'. Did you mean to use 'import Params from
  "@ohos/flutter_ohos/src/main/ets/plugin/platform/PlatformView"' instead?
  2 ERROR: ArkTS:ERROR File:
  /Users/xxxxx/.pub-cache/git/ohos_flutter_packages-b615f80433c1724d467e3a63f7861855e8144a99/packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_f
lutter/WebViewHostApiImpl.ets:16:24
Module '"@ohos/flutter_ohos/src/main/ets/plugin/platform/PlatformView"' has no exported member 'Params'. Did you mean to use 'import Params from
  "@ohos/flutter_ohos/src/main/ets/plugin/platform/PlatformView"' instead?
  3 ERROR: ArkTS:ERROR File:
  /Users/xxxxx/.pub-cache/git/ohos_flutter_packages-b615f80433c1724d467e3a63f7861855e8144a99/packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_f
lutter/WebViewHostApiImpl.ets:431:3
Property 'getView' in type 'WebViewPlatformView' is not assignable to the same property in base type 'PlatformView'.
Type '() => WrappedBuilder<[Params]>' is not assignable to type '() => DVModel'.
Type 'WrappedBuilder<[Params]>' is missing the following properties from type 'DVModel': id_, compType, params, events, and 2 more.
HarmonyOS
1天前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
put_get

可以尝试如下步骤:

1.需要把flutter升级到dev的最新版本,IDE、SDK等都需要升级到最新,使用API12。

2.清除项目缓存,先找到编译产物的地址,删掉.har。

3.环境变量 FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn。

4.删除<flutter>/bin/cache 目录,并在项目中执行flutter clean后再运行。

分享
微博
QQ
微信
回复
1天前
相关问题
HarmonyOS @ohos/mmkv 怎么更新最新版本
690浏览 • 1回复 待解决
目前鸿蒙手机最新版本是多少?
7121浏览 • 1回复 待解决
HarmonyOS 编译flutter报错
23浏览 • 1回复 待解决
flutter HarmoneyOS 版本SDK 安装指导
281浏览 • 1回复 待解决
HarmonyOS XCode 15.3无法编译flutter engine
89浏览 • 1回复 待解决
新版本的编辑器sdk怎么没有
146浏览 • 1回复 待解决
请问鸿蒙最新版本是多少?我的是nova8
11072浏览 • 1回复 待解决
HarmonyOS Flutter版本适配问题
43浏览 • 1回复 待解决
HarmonyOS flutter webview如何调试
106浏览 • 1回复 待解决
Flutter SDK支持HarmonyOS Next
1558浏览 • 1回复 待解决