CocoaPods 安装问题

18

我刚刚运行了pod install命令,在终端中显示了以下信息:

CocoaPods 0.29.0 is available.

2014-02-17 00:25:35.875 ruby[65690:507] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 908. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.

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

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 0.27.1
        Ruby : ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
    RubyGems : 2.1.10
        Host : Mac OS X 10.9.1 (13B42)
       Xcode : 5.0.1 (5A2053)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 8e7e6d8f6da821576f7b42fc513532790c8e1bc8
```

### Podfile

```ruby
platform :ios, '7.0'

pod 'SWRevealViewController'
pod 'MagicalRecord'
pod 'AFNetworking', '1.3.3'
```

### Error

```
ArgumentError - Unable to read plist data from `"/Users/mac/Documents/Projects/StatsTrack/StatsTrack.xcodeproj/project.pbxproj"': Unexpected character / at line 1
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.14.1/lib/xcodeproj/project.rb:172:in `read_plist'
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.14.1/lib/xcodeproj/project.rb:172:in `initialize_from_file'
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.14.1/lib/xcodeproj/project.rb:93:in `open'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:488:in `block in compute_target_platforms'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:485:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:485:in `compute_target_platforms'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:55:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:171:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:94:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/user_interface.rb:52:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:93:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:86:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/command/project.rb:68:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.3.2/lib/claide/command.rb:206:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/lib/cocoapods/command.rb:51:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.27.1/bin/pod:19:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/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=Unable+to+read+plist+data+from+%60%22%2FUsers%2Fmac%2FDocuments%2FProjects%2FStatsTrack%2FStatsTrack.xcodeproj%2Fproject.pbxproj%22%27%3A+Unexpected+character+%2F+at+line+1&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

如何修复?

6个回答

21

我以前也遇到过相同的问题。我通过在终端中输入以下命令来解决了这个问题:

cd ~/.cocoapods/repos
rm -rf master
pod setup

我没有主文件夹,所以我只需要运行 pod setup - ENG618
你需要通过以下命令更新 CocoaPods:sudo gem install cocoapods - Abuzeid
经过一整天的搜寻,终于找到了这个解决方法。谢谢你啊 :) - Girish Nair
我和我的朋友在一些项目中遇到了Xcode 12.2的相同问题,而其他项目则正常。但是在Xcode 12.0.1上一切都很好。我尝试了问题答案中提到的所有选项,但问题仍然存在。 - Dipak
这个程序正在运行。试一下吧。 - Dulaj Madusanka

14
你需要重新安装Cocoapods: so
sudo gem uninstall cocoapods
sudo gem install cocoapods
pod setup

8

我遇到了同样的问题。我通过在相同路径上运行以下命令来解决这个问题:

rm -rf ~/.cocoapods/repos/trunk/

pod install


2
sudo gem install cocoapods
pod install

2

合并后出现了这个问题。在解决了项目文件中的冲突之后,一切开始正常运行了。image


0

我在Xcode 12.2中遇到了与旧版本Xcode不同的相同错误。 通过以下两个命令解决了问题-

 1. pod cache clean --all
 2. sudo rm -rf ~/.cocoapods/repos

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接