我正在尝试创建ios和android应用程序,它在android上运行良好,但在运行时对于ios来说
flutter run
将花费大量时间使用pod install
安装pod,最后它会给出如下所示的错误。
Error output from CocoaPods:
↳
Cloning into
'/var/folders/f6/g4njsx3x5tx5dswcbsh29tdh0000gn/T/d20210605-16785-1rc0t
ko'...
fatal: unable to access 'https://github.com/grpc/grpc.git/': Failed to
connect to github.com port 443: Connection refused
Error running pod install
Error launching application on iPhone 12 Pro Max.
我尝试了这些帖子,但没有运气
运行 pod install 时出错
运行 pod install pods-runner 时出错
pubsec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
image_picker: ^0.6.7+17
firebase_ml_vision: ^0.9.10
image_cropper: ^1.4.0
firebase_core: ^0.3.4
cloud_firestore: ^0.9.13+1
expandable: ^5.0.1
web_scraper:
如果需要任何额外信息,请在评论中告诉我
经过多次研究,我找到了解决方案,
第1步:我使用
删除了所有cocoapods及其目录gem list --local | grep cocoapods
sudo gem uninstall EACH_OF_THEM // here EACH_OF_THEM means all the listed cocoapods
rm -rf ~/.cocoapods
第2步:安装HomeBrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
第3步:使用HomeBrew安装cocoapods
brew install cocoapods
第 4 步:删除 Podfile.lock(如果存在)
cd ios
rm Podfile.lock
第5步:现在安装pod
pod install --repo-update
下载并安装所有依赖项将花费大量时间。
现在,如果我使用
flutter run
运行 flutter 项目。成功了
...
Running pod install...
Running Xcode build...
...
参考链接:dev.to
我的Xcode版本是15.0.1,M1苹果芯片和模拟器是iPhone 15 plus。安装 Firebase 后我遇到了同样的问题,this 链接帮助我解决了该问题。互联网速度是问题所在。