北京市住房与城乡建设网站百度收录WordPress文章
news/
2025/10/6 5:27:43/
文章来源:
北京市住房与城乡建设网站,百度收录WordPress文章,搜索引擎优化到底是优化什么,泉州seo计费管理一个FlutterCocoapods项目打包问题集锦
问题1 github加速问题
cocoapods项目需要访问https://github.com/CocoaPods/Specs.git#xff0c;众所周知#xff0c;github经常被墙#xff0c;导致经常需要借助加速来下载和访问#xff0c;这里可以使用油猴脚本或者Fastgi…一个FlutterCocoapods项目打包问题集锦
问题1 github加速问题
cocoapods项目需要访问https://github.com/CocoaPods/Specs.git众所周知github经常被墙导致经常需要借助加速来下载和访问这里可以使用油猴脚本或者Fastgithub浏览器插件来解决。我的解决方案是将Fastgithub的加速网址放到gitconfig文件中
git config --global url.https://gitclone.com/github.com/CocoaPods/Specs.git.insteadOf https://github.com/CocoaPods/Specs.git这个方案问题是过一段时间加速器网址就不好使了然后需要到浏览器中再通过“github加速”关键字再找一个加速网址。
问题2 rubycocoapods环境问题
遇到问题只能反复尝试安装和卸载ruby及cocoapods了网上有的是方案。这里注意一下可以通过GEM_HOME指定Ruby版本cocopods有时候会遇到问题需要创建好master和trunk repo。如果网络好的情况下master和trunk可以直接通过git clone直接下载
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/trunk如果不行可以通过fastgithub直接访问https://github.com/CocoaPods/Specs.git的zip文件然后解压到~/.cocoapods/repos目录下再重命名为master或者trunk。
问题3 ruby安装不了3.0.0的版本可能跟openssl的版本有关系
这个时候需要先安装好openssl然后再去安装ruby。
问题4 业务问题CocoaPods could not find compatible versions for pod “shared_preferences_foundation”
[!] CocoaPods could not find compatible versions for pod shared_preferences_foundation:In Podfile:FlutterPluginRegistrant (from ../unifyapp_flutter_module/.ios/Flutter/FlutterPluginRegistrant) was resolved to 0.0.1, which depends onshared_preferences_foundationshared_preferences_foundation (from ../unifyapp_flutter_module/.ios/.symlinks/plugins/shared_preferences_foundation/ios)Specs satisfying the shared_preferences_foundation (from ../unifyapp_flutter_module/.ios/.symlinks/plugins/shared_preferences_foundation/ios), shared_preferences_foundation dependency were found, but they required a higher minimum deployment target.这个问题查的惨啊各种尝试后发现问题在于Flutter工程在执行flutter pub get后生成的.ios文件夹下面Podfile中platform的 版本是9.0, 而cocoapods主工程中Podfile的版本为10.0.
解决办法就是 1、 在flutter工程中执行完
flutter pub get以后进入.ios隐藏目录将Podfile的target版本修改为11.0然后再执行
flutter build ios --release --no-codesign2、 然后进入cocoapods主工程先把Podfile的平台版本也修改为 11.0. 然后执行
pod install至此一个困扰了3天的问题从持续集成人员手里完美解决。
记之。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/929008.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!