flutter 问题杂记
给flutter 目录不能 777权限 ,可以给775权限
# 设备m1
进入ios 项目,运行pod install 出错
错误信息
Bus Error at 0x0000000104728000 ruby 2.6.8p205
1
方法一:解决了
gem install --user-install ffi -- --enable-libffi-alloc
1
之后,pod install再次运行或任何您尝试执行的操作,但不要使用arch -x86_64.
它对我来说没有问题,这样我也可以避免采用英特尔仿真(Rosetta 2)的方式。
我在 ffi github 项目上提交的问题中找到了这个解决方案。
1
2
3
4
5
2
3
4
5
ruby - Error installing a pod - Bus Error at 0x00000001045b8000 - Stack Overflow (opens new window)
方法二:(没试过)
使用安装 gem
sudo arch -x86_64 gem install ffi
然后运行这个
arch -x86_64 pod install
1
2
3
4
5
6
2
3
4
5
6
问题二
Error output from CocoaPods:
错误信息
Error output from CocoaPods:
↳
Cloning into '/var/folders/_z/yh4xls9j3wz1fn34jbp5j82w0000gn/T/d20220112-24360-1av8vl1'...
Note: switching to 'f4633f5d9c649ec7e0ffbbbfb84847446f0c7873'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
运行
pod install --verbose
1
网络延迟,过段时间,重新运行,好了
cocoapods有一个 git 仓库专门保存了 github 上一些有名的开源组件的 podspec 文件。cocoapods会把它clone到你本地的~/.cocoapods/repo/master路径下。当你pod search 一个内容时,就在这个本地目录下进行搜索。
把 pod install
改为 pod install --verbose
之后就可看到这个过程 pod 在做什么了
- 首先会更新你的本地中心仓库
Updating spec repositories
当然这个过程会很慢,我们可以忽略它pod install --no-repo-update
- 下载源代码到本地
cocoapods会预先从github上把代码拉下来放到缓存里,缓存的目录
~/Library/Caches/Cocoapods
,知道这个是有作用的,方便清理缓存。 下载到缓存目录后把代码拷贝的你工程目录下的对应目录下:如$projectPath/Pods/ASIHTTPRequest - Generating Pods project 创建或更新Pods工程,cocoapods会创建一个Pods的project来管理这些代码,Pods工程会把公共组件代码编译为静态库文件.a给你的工程使用。
- 配置workspace 创建一个workspace管理Pods工程和你原本的工程。并通过xcconfig配置文件配置编译参数到你的原本工程中去。
# 问题
flutter真机运行报错
无法打开“iproxy”,因为无法验证开发者。
# 解决方法
执行以下命令
sudo xattr -d com.apple.quarantine
1
sudo xattr -d com.apple.quarantine
1
sudo xattr -d com.apple.quarantine
1
sudo xattr -d com.apple.quarantine ~/dev/flutter/bin/cache/artifacts/usbmuxd/iproxy
1
其中/Users/mac/flutter
是我的flutter路径,换成自己的即可
arm64. m1 编译
Error output from Xcode build:
↳
objc[19329]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x20c172c10) and
/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1141502b8). One of the two will be used. Which one is undefined.
objc[19329]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x20c172c60) and
/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x114150308). One of the two will be used. Which one is undefined.
2021-07-22 22:34:26.062 xcodebuild[19329:246509] CFURLRequestSetHTTPCookieStorageAcceptPolicy_block_invoke: no longer implemented and should not be called
** BUILD FAILED **
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
解决方法 xcode 设置
上次更新: 2022/12/11, 02:32:13