我更新了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>'
―――模板结束――――――――――――――――――――――――――――――――――――――――――――――― ―――――――――――――――――――――
[!]哦,不,发生错误。
最佳答案
看起来我找到了解决方案。我使用了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的帮助下)
关于swift - xcodeproj 1.3.1的Cocoapods错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39800894/