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

推荐订阅源

AWS News Blog
AWS News Blog
T
Tenable Blog
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 热门话题
T
Threat Research - Cisco Blogs
T
Threatpost
Security Latest
Security Latest
C
Cisco Blogs
L
Lohrmann on Cybersecurity
S
Security @ Cisco Blogs
Google Online Security Blog
Google Online Security Blog
NISL@THU
NISL@THU
AI
AI
V
Vulnerabilities – Threatpost
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Last Watchdog
The Last Watchdog
G
GRAHAM CLULEY
Cloudbric
Cloudbric
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Hacker News: Front Page
U
Unit 42
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MyScale Blog
MyScale Blog
O
OpenAI News
Scott Helme
Scott Helme
V2EX - 技术
V2EX - 技术
P
Proofpoint News Feed
博客园 - 叶小钗
Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cyberwarzone
Cyberwarzone
博客园 - 【当耐特】
H
Heimdal Security Blog
S
Schneier on Security
阮一峰的网络日志
阮一峰的网络日志
Help Net Security
Help Net Security
D
DataBreaches.Net
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
TaoSecurity Blog
TaoSecurity Blog
K
Kaspersky official blog
N
News and Events Feed by Topic
WordPress大学
WordPress大学
P
Palo Alto Networks Blog

博客园 - 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.
项目成功运行。
替代文本