当前位置:网站首页>flutter 问题总结
flutter 问题总结
2022-07-02 09:38:00 【如此简单000】
目录
方式一:Flutter/packages/flutter_tools/lib/src/web/chrome.dart中添加 ‘--disable-web-security’
run:
flutter run --no-sound-null-safety
build:
flutter build apk --no-sound-null-safety
2.使用了webview_flutter后flutter run出现问题:warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET'
is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
在flutter项目的ios目录下找到Podfile文件,在底部替换post_install.....的内容为
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
end
然后cd到ios目录下,执行Pod install,然后出现提示信息
[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
解决第一个!问题。打开PodFile,释放注释platform :ios, '9.0'
解决第二个!问题。打开Flutter/Release.xcconfig ,添加
#include "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"
然后再次运行pod install
之后还是出错,然后发现dart SDK版本号太低了,我的升级方式最终是下载新版本的flutter替换老版本文件夹。
3.本地运行跨越
方式一:Flutter/packages/flutter_tools/lib/src/web/chrome.dart中添加 ‘--disable-web-security’
'--disable-web-security',
if (headless)
...<String>[
'--headless',
'--disable-gpu',
'--no-sandbox',
'--window-size=2400,1800',
],
然后删除flutter\bin\cache下的flutter_tools.snapshot文件和flutter_tools.stamp文件。
然后运行flutter doctor,然后重启项目
方式二:
flutter run --no-sound-null-safety -d chrome --web-renderer html
边栏推荐
- [play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
- Liftover for genome coordinate conversion
- 念念不忘,必有回响 | 悬镜诚邀您参与OpenSCA用户有奖调研
- 解决uniapp列表快速滑动页面数据空白问题
- CentOS8之mysql基本用法
- Supermarket (heap overload
- Iii. Système de démarrage et d'horloge à puce
- III Chip startup and clock system
- 三.芯片啟動和時鐘系統
- Redis exceeds the maximum memory error oom command not allowed when used memory & gt; ' maxmemory'
猜你喜欢
map集合赋值到数据库
Tick Data and Resampling
Webauthn - official development document
II Stm32f407 chip GPIO programming, register operation, library function operation and bit segment operation
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched
VS2019代码中包含中文内容导致的编译错误和打印输出乱码问题
mmrotate旋转目标检测框架使用记录
Verilog 和VHDL有符号数和无符号数相关运算
enumrate的start属性的坑
二.Stm32f407芯片GPIO编程,寄存器操作,库函数操作和位段操作
随机推荐
Resources reads 2D texture and converts it to PNG format
启牛商学院给的股票账户安全吗?能开户吗?
SSRF
CTF record
【云原生】2.5 Kubernetes 核心实战(下)
The difference between self and static in PHP in methods
Appgallery connect scenario development practice - image storage and sharing
TIPC addressing 2
C# 文件与文件夹操作
Approximate sum count (approximate
Multi line display and single line display of tqdm
Some things configured from ros1 to ros2
TIPC introduction 1
How does the whole network display IP ownership?
金山云——2023届暑期实习
Iii. Système de démarrage et d'horloge à puce
Astparser parsing class files with enum enumeration methods
原生方法合并word
mysql链表数据存储查询排序问题
C file and folder operation