惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
Recent Announcements
Recent Announcements
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
G
Google Developers Blog
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
博客园 - 叶小钗
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
D
DataBreaches.Net
P
Palo Alto Networks Blog
C
Cisco Blogs
H
Hackread – Cybersecurity News, Data Breaches, AI and More
NISL@THU
NISL@THU
Forbes - Security
Forbes - Security
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
N
News and Events Feed by Topic
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog
Security Latest
Security Latest
H
Heimdal Security Blog
小众软件
小众软件
Cyberwarzone
Cyberwarzone
The Hacker News
The Hacker News
P
Privacy International News Feed
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
Scott Helme
Scott Helme
博客园 - 【当耐特】
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
Y
Y Combinator Blog
Jina AI
Jina AI
Spread Privacy
Spread Privacy
量子位
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网

博客园 - wjwdive

如何使用git submodule拆分大的git项目 MAC多github账号配置步骤 【算法】可获得的最大点数问题 使用1panel一键建站 关于混合加密(AES+RSA) C++设计模式汇总 设计模式C++005__桥模式 设计模式C++007__抽象工厂方法模式 设计模式C++004__装饰器模式 设计模式C++003__观察者模式 设计模式C++002__策略模式 设计模式C++001__模板方法 使用bundler自动化构建Xcode项目时遇到的问题。 AI图片生成网站 suno AI编曲创作利器 iOS组件化开发之私有库 iOS、Android获取apk公钥MD5信息 阿里图标库批量下载iOS适配的图标 C语言实现回调函数标准方式 swift 自定义tabbar为基本结构的项目 swift 可选类型
记录一次flutter boost5.0.2示例调试的过程
wjwdive · 2026-03-12 · via 博客园 - wjwdive

flutter boost 5.0.2 集成
背景:
直接下载了flutter boost main,所有代码。iOS项目构建不通过。

flutter boost
FlutterBoost 5.0.0 虽然是一个官方发布的正式版本,但它所属的版本区间 [4.5.0, 5.0.0) 被官方定义为了专用于适配鸿蒙(HarmonyOS)的版本

所以需降级到 4.3.2, 或者升级到 5.0.2

升级到5.0.2之后
先是
flutter 项目本身的依赖冲突,
使用 flutter outdated,
flutter pub upgrade --major-versions,
处理flutter 项目依赖冲突。

再重新安装 相关依赖。

然后pod install iOS项目。
报错:

 pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "image_picker_ios":
  In Podfile:
    image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)

Specs satisfying the `image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)` dependency were found, but they required a higher minimum deployment target.

其实是podfile 中的image_picker_ios和 platatform :ios, '11.0'冲突了。
需要升级配置platatform :ios, '15.0'

问题解决

之后,构建 XCode中 workspace.
发现:
很多flutter错误,可以查看Xcode编译错误:

lib/case/bottom_navigation_bar_demo.dart:80:12: Error: The method 'WebView' isn't defined for the type 'Test1'.
 - 'Test1' is from 'package:flutter_boost_example/case/bottom_navigation_bar_demo.dart' ('lib/case/bottom_navigation_bar_demo.dart').
Try correcting the name to the name of an existing method, or defining a method named 'WebView'.
    return WebView(
           ^^^^^^^
lib/case/webview_flutter_demo.dart:106:36: Error: The method 'WebView' isn't defined for the type 'WebViewExampleState'.
 - 'WebViewExampleState' is from 'package:flutter_boost_example/case/webview_flutter_demo.dart' ('lib/case/webview_flutter_demo.dart').
Try correcting the name to the name of an existing method, or defining a method named 'WebView'.
                            child: WebView(
                                   ^^^^^^^
lib/case/simple_webview_demo.dart:20:12: Error: The method 'WebView' isn't defined for the type 'SimpleWebViewState'.
 - 'SimpleWebViewState' is from 'package:flutter_boost_example/case/simple_webview_demo.dart' ('lib/case/simple_webview_demo.dart').
Try correcting the name to the name of an existing method, or defining a method named 'WebView'.
    return WebView(
           ^^^^^^^
lib/case/platform_view_perf.dart:123:30: Error: The method 'WebView' isn't defined for the type 'PlatformViewPerfState'.
 - 'PlatformViewPerfState' is from 'package:flutter_boost_example/case/platform_view_perf.dart' ('lib/case/platform_view_perf.dart').
Try correcting the name to the name of an existing method, or defining a method named 'WebView'.
                      child: WebView(initialUrl: url),
                             ^^^^^^^
Target kernel_snapshot_program failed: Exception
Failed to package /Users/jarvis/Documents/Projects26/FlutterProjects/flutter_boost-5.0.2/example.
Command PhaseScriptExecution failed with a nonzero exit code

排查后发现,还是 webview_flutter 的问题。
webview 示例中的版本都废弃了,官方使用了WebViewController,
使用阿里的灵码搞定。


lib/case/bottom_navigation_bar_demo.dart

lib/case/platform_view_perf.dart

lib/case/webview_flutter_demo.dart

lib/case/simple_webview_demo.dart

这四个文件中关于WebView的代码,全部替换为:

//lib/case/simple_webview_demo.dart 中
  final String viewType = '<simple-text-view>';
  //添加
  late final WebViewController controller;


  @override
  void initState() {
    super.initState();
    controller = WebViewController()        //添加  
      ..setJavaScriptMode(JavaScriptMode.unrestricted) //添加  
      ..loadRequest(Uri.parse(url));        //添加  
    // Enable virtual display.
    // if (Platform.isAndroid) WebView.platform = AndroidWebView();
  }

     child: WebView(        //删除
        initialUrl: url,    //删除

      child: WebViewWidget(     //添加  
        controller: controller, //添加  
  
//以下3个文件中,有类似操作
lib/case/bottom_navigation_bar_demo.dart

lib/case/platform_view_perf.dart

lib/case/webview_flutter_demo.dart

之后再运行 fultter:
flutter pub get
// 可选
flutter build ios //如果证书配置不正确,会失败。

xCode:
pod install

build.
项目成功运行。
替代文本