Cocoapods错误与xcodeproj 1.3.1

时间:2016-09-30 22:21:38

标签: swift xcode cocoapods

我更新了Xcode 8和Mac OS Sierra,随之更新了Cocoapods和我正在使用的pod。

我用" sudo gem update cocoapods"更新了cocoapods,它做到了这一点(这很好,并且预期):

Updating installed gems
Updating cocoapods
Fetching: cocoapods-core-1.0.1.gem (100%)
Successfully installed cocoapods-core-1.0.1
Fetching: xcodeproj-1.3.1.gem (100%)
Successfully installed xcodeproj-1.3.1
Fetching: cocoapods-1.0.1.gem (100%)
Successfully installed cocoapods-1.0.1
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Parsing documentation for cocoapods-core-1.0.1

但是在运行" pod install"之后,它给了我以下错误。

不确定发生了什么......请帮忙!

这也导致Xcode给我这个错误:

diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

以下是Cocoapods错误:

错误

RuntimeError - [Xcodeproj] Consistency issue: no parent for object `Main Group`: `` /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/helpers/groupable_helper.rb:18:in `parent' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/helpers/groupable_helper.rb:118:in `source_tree_real_path' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/helpers/groupable_helper.rb:100:in `real_path' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/helpers/groupable_helper.rb:121:in `source_tree_real_path' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/helpers/groupable_helper.rb:100:in `real_path' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/helpers/groupable_helper.rb:121:in `source_tree_real_path' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/helpers/groupable_helper.rb:100:in `real_path' /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.3.1/lib/xcodeproj/project/object/file_reference.rb:163:in `real_path' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:49:in `block (2 levels) in update_to_cocoapods_0_34' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:46:in `select' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:46:in `block in update_to_cocoapods_0_34' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:45:in `each' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:45:in `update_to_cocoapods_0_34' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:21:in `block (2 levels) in integrate' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:20:in `each' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:20:in `block in integrate' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:19:in `each' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb:19:in `integrate' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator.rb:58:in `block in integrate!' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/user_interface.rb:64:in `section' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator/target_integrator.rb:57:in `integrate!' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator.rb:129:in `each' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator.rb:129:in `integrate_user_targets' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer/user_project_integrator.rb:63:in `integrate!' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer.rb:610:in `block in integrate_user_project' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/user_interface.rb:64:in `section' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer.rb:607:in `integrate_user_project' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/installer.rb:117:in `install!' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/command/install.rb:37:in `run' /Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/command.rb:50:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/bin/pod:55:in `<top (required)>' /usr/local/bin/pod:23:in `load' /usr/local/bin/pod:23:in `<main>'

---模板结束------------------------------------------ ----------------------

[!]哦不,发生了错误。

1 个答案:

答案 0 :(得分:0)

看起来我找到了解决方案。我使用了Cocoapods App(https://cocoapods.org/app

我将这些行添加到我的Podfile的末尾:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end

(在Xcode 8 Beta 3 Use Legacy Swift issue的帮助下)