出现场景
新电脑运行一个老Flutter项目,flutter run运行ios出现以下报错。
Launching lib/main.dart on iPhone in debug mode...
Upgrading AppFrameworkInfo.plist
Upgrading Podfile
Updating project for Xcode compatibility.
Upgrading project.pbxproj
Upgrading Runner.xcscheme
Upgrading Info.plist
Removing script build phase dependency analysis.
Automatically signing iOS for device deployment using specified development team in Xcode project: YE6STNG83Y
Running pod install...
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
- Flutter
- device_info
- flutter_compass
- flutter_reactive_ble
- fluttertoast
- location_permissions
- shared_preferences
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `device_info` from `.symlinks/plugins/device_info/ios`
-> Fetching podspec for `flutter_compass` from `.symlinks/plugins/flutter_compass/ios`
-> Fetching podspec for `flutter_reactive_ble` from `.symlinks/plugins/flutter_reactive_ble/ios`
-> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
-> Fetching podspec for `location_permissions` from `.symlinks/plugins/location_permissions/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_e_c_d.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/e/c/d/Protobuf/3.23.1/Protobuf.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_4_a_9.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/a/9/SwiftProtobuf/1.21.0/SwiftProtobuf.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path downloaded: all_pods_versions_5_1_0.txt, save ETag: W/"647d3427-442"
CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.0/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.0/Toast.podspec.json
CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.1/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.1/Toast.podspec.json
CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.2/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.2/Toast.podspec.j

在尝试运行一个新的Flutter项目时,遇到了iOS构建错误,原因是CocoaPods在安装protobuf依赖时网络超时。解决方案是配置命令行代理,确保可以从GitHub下载库。通过在环境变量中设置http和https代理,然后重新运行`flutterrun`,成功执行了podinstall并解决了问题。
最低0.47元/天 解锁文章
23万+

被折叠的 条评论
为什么被折叠?



