cocoapods

CocoaPods安装及使用

旧巷老猫 提交于 2020-03-05 19:57:29
#CocoaPods CocoaPods是iOS的类库管理工具 CocoaPods 的原理,是将所有的依赖库都放到另一个名为 Pods 项目中,然后让主项目依赖 Pods 项目,这样,源码管理工作都从主项目移到了 Pods 项目中。 Pods 项目最终会编译成一个名为 libPods.a 的文件,主项目只需要依赖这个 .a 文件即可。 对于资源文件,CocoaPods 提供了一个名为 Pods-resources.sh 的 bash 脚本,该脚本在每次项目编译的时候都会执行,将第三方库的各种资源文件复制到目标目录中。 CocoaPods 通过一个名为 Pods.xcconfig 的文件来在编译时设置所有的依赖和参数。 在安装CocoaPods之前,首先要在本地安装好Ruby环境。 ###Ruby环境搭建 #查看当前ruby版本 ruby -v #列出已知的ruby版本 rvm list known #安装ruby 1.9.3 rvm install 1.9.3 ###下载和安装CocoaPods 升级 gem sudo gem update --system 用淘宝的Ruby镜像来访问cocoapods gem sources --remove https://rubygems.org/ // 等有反应之后再敲入以下命令 gem sources -a http://ruby

iOS开发总结-Xcode常见错误

时间秒杀一切 提交于 2020-03-05 15:22:59
这篇文章中收录了Xcode出现的各种错误,并对错误给出了正确的解决方案,以便帮助遇到困难的朋友。 文章由作者刘小壮维护并持续更新,有新的问题并且文章中没有收录的,可以在下面评论区中提出,我会收录在文章中供大家参考。如果有问题不能解决的,也可以在下方评论区中提出,我会尽力帮助解决,并且将解决方案添加到文章中供其他人参考。 "file/file.h" file not found 如果遇到这种类型的问题报错,可以分为三部来解决,由简到复杂一步一步来,直到解决问题位置。 1. 点击Xcode -> Project -> Clean清除缓存或者使用⌘ + ⇧ + k快捷键来清除。 2. 点击Xcode -> Window -> Projects 清除Derived Data的缓存,在清除缓存之前先彻底退出Xcode,然后直接删除缓存文件夹。 3. 再Build Settings -> Header Search Paths 添加路径,$(SRCROOT)/项目名称/文件路径。 如果上面这三种方法都没有解决问题,就要考虑一下文件是否存在或者导入方式是否有错误了。例如: # include<> 和 # include"" 、 # import<> 和 # import"" 的导入方式是否有错误。 ld: -pie can only be used when targeting iOS 4.2

CocoaPods debug.xcconfig: unable to open file in target

纵饮孤独 提交于 2020-03-05 03:37:29
问题 I have my code from my other machine, which is working without pod install , but after pod install it gives me following error error: /Users/UserName/Documents/MyApp/Target Support Files/Pods-MyApp/Pods-MyApp.debug.xcconfig: unable to open file (in target "MyApp" in project "MyApp") (in target 'MyApp') Tried pod deintegrate and pod init again given in this link, deleted Podfile.lock and Pod folder. pod --version 1.7.4 Xcode - 10.2 回答1: This answer helped: “pod deintegrate” “sudo gem install

CocoaPods debug.xcconfig: unable to open file in target

大憨熊 提交于 2020-03-05 03:35:11
问题 I have my code from my other machine, which is working without pod install , but after pod install it gives me following error error: /Users/UserName/Documents/MyApp/Target Support Files/Pods-MyApp/Pods-MyApp.debug.xcconfig: unable to open file (in target "MyApp" in project "MyApp") (in target 'MyApp') Tried pod deintegrate and pod init again given in this link, deleted Podfile.lock and Pod folder. pod --version 1.7.4 Xcode - 10.2 回答1: This answer helped: “pod deintegrate” “sudo gem install

pod》error:The dependency `` is not used in any concrete target

醉酒当歌 提交于 2020-03-04 22:08:20
一、概要 iOS 开发时,项目中会引用许多第三方库,CocoaPods( https://github.com/CocoaPods/CocoaPods )可以用来方便的统一管理这些第三方库(从一个坑出来,又进了另一个坑而已……)。 二、安装 由于网上的教程基本都大同小异,但细节之处还不是很完善,所以借机会在这里补充下: 注:要使用CocoaPods,那就要下载安装它,而下载安装CocoaPods需要Ruby环境 1、Ruby环境搭建 当前安装环境为Mac mini 10.8.5。Mac OS本身自带Ruby,但还是更新一下保险,因为我第一次安装在没有更新Ruby的情况下就失败了。 a 查看下当前ruby版本:打开终端输入 ruby -v(确实安装了,不过用这个版本接下来工作失败了,所以更新下ruby) ritekiMac-mini:PodTest lucky$ ruby -v ruby 1 .8 .7 ( 2 0 1 2- 0 2- 0 8 patchlevel 3 5 8) [universal-darwin 1 2 .0] ritekiMac-mini:PodTest lucky$ b 更新ruby 终端输入如下命令(把Ruby镜像指向taobao,避免被墙,你懂得) gem sources --remove https://rubygems.org/ gem sources

Is There an Alternative Way to Incorporate Firebase into my iOS App Other Than Cocoapods?

蓝咒 提交于 2020-03-04 19:40:10
问题 My iPhone recently automatically updated to iOS 13.3.1, and unknown to me until it was to late apparently Apple blocked the use of some external frameworks when testing apps on a physical device within Xcode. I can no longer run my app on my iPhone (although the simulator still works but it's SO much more inconvenient). I'm using cocoapods and the one that's causing the issue is Firebase. I need Firebase, so my question is: Is there another way to integrate Firebase into my app without using

Is There an Alternative Way to Incorporate Firebase into my iOS App Other Than Cocoapods?

五迷三道 提交于 2020-03-04 19:40:06
问题 My iPhone recently automatically updated to iOS 13.3.1, and unknown to me until it was to late apparently Apple blocked the use of some external frameworks when testing apps on a physical device within Xcode. I can no longer run my app on my iPhone (although the simulator still works but it's SO much more inconvenient). I'm using cocoapods and the one that's causing the issue is Firebase. I need Firebase, so my question is: Is there another way to integrate Firebase into my app without using

ios - where to put s.static_framework = true

好久不见. 提交于 2020-03-03 12:17:08
问题 I am level 0 in CocoaPods. When I am using the pod install there is an error says: The 'Pods-App' target has transitive dependencies that include static frameworks I try to search around and see the solution in the FIRST answer. Pranav Gupta said that I need to add s.static_framework = true to my podspec. However, I don't know exactly where. Please guide me if you know how I can put the s.static_framework = true in my Podfile. Thank you in advance! 回答1: thank you for helping, I am able to

iOS开发-CocoaPods的安装与使用

走远了吗. 提交于 2020-03-01 15:01:49
第三方类库管理工具 —CocoaPods 原因 : 假设项目中引入了 10 个第三方框架 , 框架会被作者不断更新 . 不可能天天盯着作者有没有更新 . cocoaPods 可以帮助我们自动更新第三方框架 . 假设 第三方框架 A 依赖框架 B, B 又依赖框架 C, C 依赖框架 D....... cocoapods 只能管理 Github 上的框架 插件 — 给 Xcode 安装的 , 方便操作 xcode 框架 — 集成在项目中的 , 是代码 如何安装 cocoaPods 1. 需要翻墙 — 有条件可以直接翻墙 直接在终端中输入 sudo gem install cocoapods 即可 2. 非翻墙情况 2.1 在终端中 输入 gem sources 查看软件安装源 . 默认源是 https://rubygems.org/, 这是亚马逊提供的 , 因为是国外的 , 被中国官方屏蔽了 2.2 需要找一个 没有被屏蔽的源 , 添加进去 新的源 https://ruby.taobao.org/ 终端以此输入 : 查看当前源 gem sources 1. 删除默认源 : sudo gem sources - -remove https://rubygems.org/ 2. 添加 taobao 源 : sudo gem sources -a https://ruby.taobao

iOS开发之Xcode常见错误

爷,独闯天下 提交于 2020-02-29 06:20:19
一."file/file.h" file not found 如果遇到这种类型的问题报错,可以分为三部来解决,由简到复杂一步一步来,直到解决问题位置。 1. 点击Xcode -> Project -> Clean清除缓存或者使用⌘ + ⇧ + k快捷键来清除。 2. 点击Xcode -> Window -> Projects 清除Derived Data的缓存,在清除缓存之前先彻底退出Xcode,然后直接删除缓存文件夹。 3. 再Build Settings -> Header Search Paths 添加路径,$(SRCROOT)/项目名称/文件路径。 如果上面这三种方法都没有解决问题,就要考虑一下文件是否存在或者导入方式是否有错误了。例如: # include<> 和 # include"" 、 # import<> 和 # import"" 的导入方式是否有错误。 ld: -pie can only be used when targeting iOS 4.2 or later clang: error: linker command failed with exit code 1 (use -v to see invocation) 首先注意: -pie can only be used when targeting iOS 4.2 or later -pie