cocoapods

cocoapods管理更新第三方库

匿名 (未验证) 提交于 2019-12-03 00:22:01
第一步:安装rvm, 不管需不需要升级ruby,rvm可以让你拥有多个版本的Ruby,并且可以在多个版本之间自由切换。如果已经安装过跳到第2步(rvm -v 查看是否安装) $ curl -L get.rvm.io | bash -s stable //需要等一会 source ~/.bashrc source ~/.bash_profile $ rvm -v 如果能显示版本好则安装成功了。 第二步:安装ruby CocoaPods目前安装需要Ruby的版本大于2.2.2,不然会报错: Error installing pods: activesupport requires Ruby version >= 2.2.2 。目前Mac系统默认自带是2.0,所以需要升级。 查看已安装的ruby: $ rvm list 如果已安装版本大于2.2.2,直接到第3步。 也可以查看ruby版本$ ruby -v //列出ruby可安装的版本信息 $ rvm list known //安装一个ruby版本 $ rvm install 2.2.2 第三步:更换源 我们需要来修改更换源(由于国内被墙),taobao Gems 源已停止维护,现由 ruby-china 提供镜像服务,所以要把源切换至ruby-china, 更新先:$ sudo gem update --system

weex运行ios报错:/bin/sh: pod: command not found解决办法

匿名 (未验证) 提交于 2019-12-03 00:22:01
原因:weex使用了CocoaPods 解决办法: sudo gem install -n /usr/ local /bin cocoapods 因为CocoaPods是一个负责管理iOS项目中第三方开源库的工具。CocoaPods的项目源码在Github上管理。该项目开始于2011年8月12日,在这两年多的时间里,它持续保持活跃更新。开发iOS项目不可避免地要使用第三方开源库,CocoaPods的出现使得我们可以节省设置和更新第三方开源库的时间 Good Luck~ 文章来源: weex运行ios报错:/bin/sh: pod: command not found解决办法

ios学习笔记5--CocoPods使用详解

匿名 (未验证) 提交于 2019-12-03 00:19:01
文章背景: iOS开发避免不了要使用第三方库,第三方库给我们打开方便之门的同时,也带来了一些不必要的麻烦,比如:开源库需要依赖一些framework,这个手动的加载到你的工程当中;对于某些三方库需要设置一些编译参数;还有就是,当你想使用某个三方库的最新版本的时候,需要手动移除当前项目中的三方库、然后添加最新的三方库、甚至还需要重新配置参数。 以上这些都是毫无意义的体力活,但是又不得不做,不过每种语言发展到一定阶段,都会出现相应的依赖管理工具,CocoaPods应运而生。 为了避免每次遇到问题,都要从网上搜索一波的尴尬局面,也为了节约开发时间。因此,本文将详细从以下几个方面进行详细讲解,作为后续开发参考,高手勿喷。 CocoaPods安装基本步骤 xcode中集成CocoaPods cocoaPods常用指令及注意事项 让自己的开源项目支持CocoaPods 创建自己私有的pods 一、CocoaPods的安装基本步骤 CocoaPods的安装步骤,网上一搜索、相关文章铺天盖地,这里简明扼要的介绍一下需要用到的指令,详细内容见后面的参考网址。 Mac自带ruby环境,首先升级ruby的gem命令 sudo gem update --system 因为ruby的镜像被我天朝屏蔽,需要移除当前镜像,添加国内的镜像 gem sources --remove https://rubygems

cocoapods报错 [!] Couldn't determine repo type for URL: `https://cdn.cocoapods.org/`: execution expired

匿名 (未验证) 提交于 2019-12-03 00:15:02
cocoapods 1.7.2版本后CDN为默认值 使用1.8,CocoaPods不再需要克隆现在巨大的主规格repo才能运行,用户几乎可以立即将他们的项目与CocoaPods集成。 编辑Podfile以将CDN设置为主要来源: source ' https://cdn.cocoapods.org/ ' 来源:博客园 作者: JustToGo 链接:https://www.cnblogs.com/xbios/p/11736964.html

CocoaPods 构建自己的 Pod 库

匿名 (未验证) 提交于 2019-12-03 00:12:02
构建一个自己的库供其它人使用是不是一件很酷(苦)的事情,通过 CocoaPods 可以快捷的构建自己库,并向全世界分享你的成果 有两种方式: 使用命令 pod lib create mylib 创建一套完整的 Pod 库模版 使用命令 pod spec create mylib 创建 Podspec 的配置文件 官网说明: https://guides.cocoapods.org/syntax/podspec.html#specification Pod :: Spec . new do | spec | spec . name = 'libminipng' spec . version = '0.0.5' spec . license = { : type => 'MIT' } spec . homepage = 'http://www.ichochy.com' spec . authors = { 'iChochy' => 'iChochy@qq.com' } spec . summary = 'Swift library that compresses PNG' spec . source = { : git => 'https://github.com/iChochy/libminipng.git' , : tag => 'v3.1.0' } spec . source

Load image from CocoaPods resource bundle

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 00:09:50
I am creating a private library that includes resources that are referenced by components in the library. The library is shared with apps using CocoaPods. In the .podspec for the library, I've included a line like this: s.resource_bundles = {'IXMapKitResources' => ['IXMapKit/Resources/*']} One of the resources in the bundle is an asset catalog with multiple image sets, one of which is called 'IXMKAnnotationIcons-Normal-Accident'. The following code returns a nil: UIImage * image = [UIImage imageNamed: @"IXMKAnnotationIcons-Normal-Accident"]; I found an article on mokacoding.com describing how

pod安装失败,Operation not permitted - /usr/bin/pod

匿名 (未验证) 提交于 2019-12-03 00:04:02
个人博客地址: http://www.pluto-y.com 博主在升级秤Mac OS X EL Capitan后,发现尼玛,好多命令不见了。然后我的内心几乎是崩溃的,天哪撸!苹果,你怎么能这样对待我,我好不容易安装好的命令你竟然这样把我抛弃。然后最先发现的应该就是我的pod兄弟,麻痹,竟然不见了。 然后我就下意识的就开始安装,并在terminal中输入了 sudo gem install cocoapods ,结果竟然出现了: 然后就出现了这样: ,扶好扶好,不要激动,要淡定。 然后我就找啊找啊找朋友,找到一个好朋友。终于给我找到了解决方案,这里提供两种方案给大家借鉴: 方案一: $ mkdir -p $HOME/Software/ruby $ export GEM_HOME=$HOME/Software/ruby $ gem install cocoapods [ ... ] 1 gem installed cocoapods $ export PATH=$PATH:$HOME/Sofware/ruby/bin 方案一中主要是将GEM的安装路径进行修改,将GEM的默认安装路径修改成了 $HOME/Software/ruby 这个目录,然后再进行安装,最后将安装路径添加到 PATH 下,这样可以不用带完整的路径进行运行命令。 方案二: $ gem install

Cocoapods error: “Pull is not possible because you have unmerged files.”

孤人 提交于 2019-12-02 23:26:10
When installing a new CocoaPod, I got the following error. $ pod install Analyzing dependencies [!] Pod::Executable pull A AFHARchiver/0.2.1/AFHARchiver.podspec A AFWunderlist/1.0/AFWunderlist.podspec A AFWunderlist/1.1/AFWunderlist.podspec A AFgzipRequestSerializer/0.0.1/AFgzipRequestSerializer.podspec . . . A wpxmlrpc/0.4/wpxmlrpc.podspec A zipzap/6.0/zipzap.podspec Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use `'git add/rm <file>'` as appropriate to mark resolution, or use `'git commit -a'`. Thought I would share the fix below.

Xcode: ld: library not found for -lAFNetworking

早过忘川 提交于 2019-12-02 23:23:10
Because of this one reason, build always fails...Any ideas about what I could try? EDIT: the solution is to open the xcworkspace instead of the xcproject! Might be you are opening .xcodeproj file after installing pods. Close the project and open .xcworkspace file. Have the same issue. What I did with the help of https://premium.wpmudev.org/forums/topic/anybody-solved-this-linker-command-failed-with-exit-code-1 and Adlair Cerecedo-Mendez Delete the "Pods" project on the left panel of Xcode. Close Xcode and delete this file in the finder too. Install pods again. Open Xcode and clean. Verify that

pod install failed with error: Library (from `../`)` required by `Podfile` when pod install in iOS

半城伤御伤魂 提交于 2019-12-02 23:21:10
I am making a cocoapods. I am using pod lib create MyLibrary to create a new cocoapods. After it's done, I added two files into MyLibrary/Pod/Classes/. And I commit and add a tag and then push to origin master. and the MyLibrary.podspec passed validation. So, I go into the Example folder which created when I do pod lib create MyLibrary . and do a pod install in the terminal. But I am getting error: Analyzing dependencies Fetching podspec for `MyLibrary` from `../` [!] Unable to satisfy the following requirements: - `MyLibrary (from `../`)` required by `Podfile` The podspec settings are all