cocospods 出錯的解決方法(一)

pod install安裝第三方庫時出現(xiàn)錯誤:

(一)pod install安裝第三方庫出錯如下栏账,解決方法是:

sudo rm -rf ~/.cocoapods/repos

nhldeMac:ProjectQiuShi nhl$ pod install

Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command



/usr/local/bin/pod install



### Report

* What did you do?

* What did you expect to happen?

* What happened instead?

### Stack



   CocoaPods : 1.11.3

        Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]

    RubyGems : 3.0.3.1

        Host : macOS 12.5.1 (21G83)

       Xcode : 13.4.1 (13F100)

         Git : git version 2.32.1 (Apple Git-133)

Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib

Repositories : artsy - git - https://github.com/Artsy/Specs.git @ d8a458af37f3689c499f42acff15371af90e042e

               trunk - CDN - https://cdn.cocoapods.org/



### Plugins



cocoapods-deintegrate : 1.0.5

cocoapods-plugins    : 1.0.0

cocoapods-search      : 1.0.1

cocoapods-trunk      : 1.6.0

cocoapods-try        : 1.2.0



### Podfile

ruby

platform:ios,'10.0'

use_frameworks!

target 'ProjectQiuShi' do

    pod 'Alamofire'

    pod 'SwiftyJSON'

    pod 'MJRefresh'

    pod 'Kingfisher'

end



### Error



JSON::ParserError - 767: unexpected token at '{

  "name": "Kingfisher",

  "version": "3.13.1",

  "summary": "A lightweight and pure Swift implemented library for downloading and cacheing image from the we'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/json.rb:61:in `from_json'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:748:in `from_string'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:722:in `from_file'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source.rb:188:in `specification'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver/lazy_specification.rb:37:in `specification'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:348:in `block in delegating_block'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:178:in `dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:18:in `block in dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:17:in `dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:809:in `block in group_possibilities'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:808:in `reverse_each'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:808:in `group_possibilities'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:779:in `possibilities_for_requirement'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:761:in `push_state_for_requirements'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:727:in `activate_new_spec'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:684:in `attempt_to_activate'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'

/usr/local/bin/pod:23:in `load'

/usr/local/bin/pod:23:in `<main>'


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:

https://github.com/CocoaPods/CocoaPods/search?q=767%3A+unexpected+token+at+%27%7B%0A++%22name%22%3A+%22Kingfisher%22%2C%0A++%22version%22%3A+%223.13.1%22%2C%0A++%22summary%22%3A+%22A+lightweight+and+pure+Swift+implemented+library+for+downloading+and+cacheing+image+from+the+we%27&type=Issues

If none exists, create a ticket, with the template displayed above, on:

https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:

https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

Found no similar issues. To create a new issue, please visit:

https://github.com/cocoapods/cocoapods/issues/new

nhldeMac:ProjectQiuShi nhl$ pod install

Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command


/usr/local/bin/pod install



### Report

* What did you do?

* What did you expect to happen?

* What happened instead?

### Stack


   CocoaPods : 1.11.3

        Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]

    RubyGems : 3.0.3.1

        Host : macOS 12.5.1 (21G83)

       Xcode : 13.4.1 (13F100)

         Git : git version 2.32.1 (Apple Git-133)

Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib

Repositories : artsy - git - https://github.com/Artsy/Specs.git @ d8a458af37f3689c499f42acff15371af90e042e

               trunk - CDN - https://cdn.cocoapods.org/



### Plugins


cocoapods-deintegrate : 1.0.5

cocoapods-plugins    : 1.0.0

cocoapods-search      : 1.0.1

cocoapods-trunk      : 1.6.0

cocoapods-try        : 1.2.0



,### Podfile

ruby

platform:ios,'7.0'

use_frameworks!

target 'ProjectQiuShi' do

    pod 'Alamofire'

    pod 'SwiftyJSON'

    pod 'MJRefresh'

    pod 'Kingfisher'

end



### Error



JSON::ParserError - 767: unexpected token at '{

  "name": "Kingfisher",

  "version": "3.13.1",

  "summary": "A lightweight and pure Swift implemented library for downloading and cacheing image from the we'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/json.rb:61:in `from_json'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:748:in `from_string'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:722:in `from_file'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source.rb:188:in `specification'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver/lazy_specification.rb:37:in `specification'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:348:in `block in delegating_block'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/delegate.rb:349:in `block in delegating_block'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:178:in `dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:18:in `block in dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:17:in `dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:809:in `block in group_possibilities'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:808:in `reverse_each'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:808:in `group_possibilities'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:779:in `possibilities_for_requirement'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:761:in `push_state_for_requirements'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:727:in `activate_new_spec'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:684:in `attempt_to_activate'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'

/usr/local/bin/pod:23:in `load'

/usr/local/bin/pod:23:in `<main>'



――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:

https://github.com/CocoaPods/CocoaPods/search?q=767%3A+unexpected+token+at+%27%7B%0A++%22name%22%3A+%22Kingfisher%22%2C%0A++%22version%22%3A+%223.13.1%22%2C%0A++%22summary%22%3A+%22A+lightweight+and+pure+Swift+implemented+library+for+downloading+and+cacheing+image+from+the+we%27&type=Issues

If none exists, create a ticket, with the template displayed above, on:

https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:

https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

Found no similar issues. To create a new issue, please visit:

https://github.com/cocoapods/cocoapods/issues/new

修改錯誤

nhldeMac:ProjectQiuShi nhl$ sudo rm -rf ~/.cocoapods/repos
Password:
nhldeMac:ProjectQiuShi nhl$ pod install

(二)輸入該命令之后該錯誤就不見了,可以繼續(xù)pod install了范舀。如果出現(xiàn)錯誤:

nhldeMac:ProjectQiuShi nhl$ pod install
Analyzing dependencies
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
[!] CocoaPods could not find compatible versions for pod "Kingfisher":
  In Podfile:
    Kingfisher

Specs satisfying the `Kingfisher` dependency were found, but they required a higher minimum deployment target.

這是因為podfile文件里的platform的ios版本過低仔拟,某些加入的第三方庫不支持衫樊。

(podfile的庫文件支持的版本過低,無法滿足第三方庫Kingfisher的應(yīng)用利花,需要升級科侈,例如) platform:ios,’7.0’需要改為platform:ios,’8.0’(Kingfisher最低大于7.0)

podfile文件內(nèi)容:

platform:ios,’8.0’
use_frameworks!

target 'ProjectQiuShi' do

    pod 'Alamofire'
    pod 'SwiftyJSON'
    pod 'Kingfisher'
    pod 'MJRefresh'

end

podfile文件修改后繼續(xù)pod install就可以了。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末炒事,一起剝皮案震驚了整個濱河市臀栈,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌挠乳,老刑警劉巖权薯,帶你破解...
    沈念sama閱讀 211,265評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件姑躲,死亡現(xiàn)場離奇詭異,居然都是意外死亡崭闲,警方通過查閱死者的電腦和手機肋联,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,078評論 2 385
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來刁俭,“玉大人橄仍,你說我怎么就攤上這事‰蛊荩” “怎么了侮繁?”我有些...
    開封第一講書人閱讀 156,852評論 0 347
  • 文/不壞的土叔 我叫張陵,是天一觀的道長如孝。 經(jīng)常有香客問我宪哩,道長,這世上最難降的妖魔是什么第晰? 我笑而不...
    開封第一講書人閱讀 56,408評論 1 283
  • 正文 為了忘掉前任锁孟,我火速辦了婚禮,結(jié)果婚禮上茁瘦,老公的妹妹穿的比我還像新娘品抽。我一直安慰自己,他們只是感情好甜熔,可當我...
    茶點故事閱讀 65,445評論 5 384
  • 文/花漫 我一把揭開白布圆恤。 她就那樣靜靜地躺著,像睡著了一般腔稀。 火紅的嫁衣襯著肌膚如雪盆昙。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,772評論 1 290
  • 那天焊虏,我揣著相機與錄音淡喜,去河邊找鬼。 笑死诵闭,一個胖子當著我的面吹牛拆火,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播涂圆,決...
    沈念sama閱讀 38,921評論 3 406
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼币叹!你這毒婦竟也來了润歉?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,688評論 0 266
  • 序言:老撾萬榮一對情侶失蹤颈抚,失蹤者是張志新(化名)和其女友劉穎踩衩,沒想到半個月后嚼鹉,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,130評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡驱富,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,467評論 2 325
  • 正文 我和宋清朗相戀三年锚赤,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片褐鸥。...
    茶點故事閱讀 38,617評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡线脚,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出叫榕,到底是詐尸還是另有隱情浑侥,我是刑警寧澤,帶...
    沈念sama閱讀 34,276評論 4 329
  • 正文 年R本政府宣布晰绎,位于F島的核電站寓落,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏荞下。R本人自食惡果不足惜伶选,卻給世界環(huán)境...
    茶點故事閱讀 39,882評論 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望尖昏。 院中可真熱鬧仰税,春花似錦、人聲如沸会宪。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,740評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽掸鹅。三九已至塞帐,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間巍沙,已是汗流浹背葵姥。 一陣腳步聲響...
    開封第一講書人閱讀 31,967評論 1 265
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留句携,地道東北人榔幸。 一個月前我還...
    沈念sama閱讀 46,315評論 2 360
  • 正文 我出身青樓,卻偏偏與公主長得像矮嫉,于是被迫代替她去往敵國和親削咆。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 43,486評論 2 348