生成pods项目时出错 - Pod安装

时间:2023-01-17 23:20:20

I have a working project that uses cocoa pods. I tried to 'pod install' and got this weird error:

我有一个使用可可豆荚的工作项目。我尝试'pod install'并得到了这个奇怪的错误:

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Linking headers
  - Installing targets
    - Installing target `Pods-NIDropDown` iOS 7.0
    - Installing target `Pods-SDWebImage` iOS 7.0
    - Installing target `Pods-SQCommonUtils` iOS 7.0
    - Installing target `Pods` iOS 7.0
  - Running post install hooks
  - Writing Xcode project file to `Pods/Pods.xcodeproj`
2015-06-27 01:20:37.359 ruby[3841:138874] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-8123.33/IDEFoundation/Initialization/IDEInitialization.m:590
Details:  Assertion failed: _initializationCompletedSuccessfully
Function: BOOL IDEIsInitializedForUserInteraction()
Thread:   <NSThread: 0x7fedd50822b0>{number = 1, name = main}
Hints: None
Backtrace:
  0  0x00000001057f7047 -[DVTAssertionHandler handleFailureInFunction:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
  1  0x00000001057f67d4 _DVTAssertionHandler (in DVTFoundation)
  2  0x00000001057f6a40 _DVTAssertionFailureHandler (in DVTFoundation)
  3  0x00000001057f69a2 _DVTAssertionFailureHandler (in DVTFoundation)
  4  0x0000000106bbf1a9 IDEIsInitializedForUserInteraction (in IDEFoundation)
  5  0x000000010ab2ea5d +[PBXProject projectWithFile:errorHandler:readOnly:] (in DevToolsCore)
  6  0x000000010ab305e2 +[PBXProject projectWithFile:errorHandler:] (in DevToolsCore)
  7  0x00007fff9262af44 ffi_call_unix64 (in libffi.dylib)
Abort trap: 6

No idea why i got a error Writing Xcode project file to Pods/Pods.xcodeproj. I've tried reinstall cocoa pods, but not succeed.

不知道为什么我将Xcode项目文件写入Pods / Pods.xcodeproj时出错。我尝试过重新安装可可豆荚,但没有成功。

I'm kind of noob with iOS development, so any tips would be nice.

我是iOS开发人员,所以任何提示都会很好。

7 个解决方案

#1


21  

I was having this problem working with Xcode 7 beta 2. Setting xcode-select back to the released version of Xcode helped me.

我在使用Xcode 7 beta 2时遇到了这个问题。设置xcode-select回到Xcode的发布版本帮助了我。

Try running this in terminal:

尝试在终端中运行:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Then try your CocoaPods install again:

然后再次尝试安装CocoaPods:

pod install

I then had no problems going back to the Xcode beta with this command:

然后我用这个命令回到Xcode测试版没问题:

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

#2


28  

Seems to be an issue with project serialization with Xcode 7. Cocoapods relies on xcodeproj, which has a bug with the latest betas. They've put out a quick release to address the issue. Run this in the terminal:

似乎是使用Xcode 7进行项目序列化的问题.Cocoapods依赖于xcodeproj,它有最新测试版的bug。他们发布了一个快速发布来解决这个问题。在终端中运行:

gem install xcodeproj -v 0.24.3

gem install xcodeproj -v 0.24.3

(may have to sudo that)

(可能要sudo那个)

#3


21  

For those getting the error after the recent Xcode update, I did the above and it didn't work until I updated cocoa pods (from version 0.36.0) :

对于那些在最近的Xcode更新后得到错误的人,我做了上面的工作,直到我更新了cocoa pods(从版本0.36.0开始)它才能工作:

sudo gem update

This updated it to 0.38.2 (I have also seen references to 0.37.x having problems)

这更新到0.38.2(我也看到有0.37.x的参考有问题)

#4


4  

You just follow the below terminal commands. It may help you.

您只需按照以下终端命令即可。它可能会帮助你。

$sudo gem update —system
$sudo gem uninstall cocoapods
$sudo gem install cocoapods
$pod setup
$cd <project path>
$pod init
add files(frameworks)($pod outdated- if already pod exists)
$pod install
$pod update(if you need)

#5


3  

Before retrying the 'pod install' open a second terminal window and tail your system log:

在重试“pod install”之前,打开第二个终端窗口并拖尾系统日志:

tail -f /var/log/system.log

You might be surprised what you learn. Mine reported that

你可能会对你学到的东西感到惊讶。我报告说

pod install[20810]: [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.dbg.DebuggerFoundation (/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3587 "The bundle “DebuggerFoundation” couldn’t be loaded because it is damaged or missing necessary resources." (dlopen_preflight(/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin/Contents/MacOS/DebuggerFoundation): Library not loaded: @rpath/IBAutolayoutFoundation.framework/Versions/A/IBAutolayoutFoundation

pod安装[20810]:[MT] DVTPlugInLoading:无法加载插件com.apple.dt.dbg.DebuggerFoundation(/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin)的代码,错误=错误Domain = NSCocoaErrorDomain Code = 3587“无法加载捆绑包”DebuggerFoundation“,因为它已损坏或缺少必要的资源。” (dlopen_preflight(/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin/Contents/MacOS/DebuggerFoundation):未加载库:@ rpath / IBAutolayoutFoundation.framework / Versions / A / IBAutolayoutFoundation

So since my installation of Xcode 7.0.1 via the Mac App Store ended up being corrupted none of the suggestions by all the other helpful responders here were destined to work.

因此,由于我通过Mac App Store安装Xcode 7.0.1最终被破坏,所有其他有用的响应者的建议都没有注定要工作。

These things never crop up when you have plenty of time to throughly troubleshoot them. It certainly isn't that time for our release schedule right now, so what worked here (OS X 10.10.5, departing Xcode 6.4 for Xcode 7.0.1) was (and this is after having asked the App Store to reinstall 7.0.1)

当你有足够的时间彻底排除故障时,这些事情永远不会出现。现在肯定不是我们发布时间表的时间,所以这里有用(OS X 10.10.5,Xcode 7.0.1的Xcode 6.4)(这是在要求App Store重新安装7.0.1之后) )

rm -Rf /Applications/Xcode.app

Followed by asking the Mac App Store to reinstall Xcode 7.0.1

随后要求Mac App Store重新安装Xcode 7.0.1

Then we were able to proceed with updating CocoaPods, etc. etc. etc.

然后我们就可以继续更新CocoaPods等等。

#6


1  

sudo xcode-select -r fixed the issue

sudo xcode-select -r修复了这个问题

#7


1  

Everyone suggested an xcode problem, what solved it for me was removing all of cocoapods gems, then reinstalling them:

每个人都提出了一个xcode问题,为我解决的问题是删除了所有的cocoapods宝石,然后重新安装它们:

gem list | grep cocoapods | xargs gem uninstall -aIx
gem uninstall xcodeproj

#1


21  

I was having this problem working with Xcode 7 beta 2. Setting xcode-select back to the released version of Xcode helped me.

我在使用Xcode 7 beta 2时遇到了这个问题。设置xcode-select回到Xcode的发布版本帮助了我。

Try running this in terminal:

尝试在终端中运行:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Then try your CocoaPods install again:

然后再次尝试安装CocoaPods:

pod install

I then had no problems going back to the Xcode beta with this command:

然后我用这个命令回到Xcode测试版没问题:

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

#2


28  

Seems to be an issue with project serialization with Xcode 7. Cocoapods relies on xcodeproj, which has a bug with the latest betas. They've put out a quick release to address the issue. Run this in the terminal:

似乎是使用Xcode 7进行项目序列化的问题.Cocoapods依赖于xcodeproj,它有最新测试版的bug。他们发布了一个快速发布来解决这个问题。在终端中运行:

gem install xcodeproj -v 0.24.3

gem install xcodeproj -v 0.24.3

(may have to sudo that)

(可能要sudo那个)

#3


21  

For those getting the error after the recent Xcode update, I did the above and it didn't work until I updated cocoa pods (from version 0.36.0) :

对于那些在最近的Xcode更新后得到错误的人,我做了上面的工作,直到我更新了cocoa pods(从版本0.36.0开始)它才能工作:

sudo gem update

This updated it to 0.38.2 (I have also seen references to 0.37.x having problems)

这更新到0.38.2(我也看到有0.37.x的参考有问题)

#4


4  

You just follow the below terminal commands. It may help you.

您只需按照以下终端命令即可。它可能会帮助你。

$sudo gem update —system
$sudo gem uninstall cocoapods
$sudo gem install cocoapods
$pod setup
$cd <project path>
$pod init
add files(frameworks)($pod outdated- if already pod exists)
$pod install
$pod update(if you need)

#5


3  

Before retrying the 'pod install' open a second terminal window and tail your system log:

在重试“pod install”之前,打开第二个终端窗口并拖尾系统日志:

tail -f /var/log/system.log

You might be surprised what you learn. Mine reported that

你可能会对你学到的东西感到惊讶。我报告说

pod install[20810]: [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.dbg.DebuggerFoundation (/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3587 "The bundle “DebuggerFoundation” couldn’t be loaded because it is damaged or missing necessary resources." (dlopen_preflight(/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin/Contents/MacOS/DebuggerFoundation): Library not loaded: @rpath/IBAutolayoutFoundation.framework/Versions/A/IBAutolayoutFoundation

pod安装[20810]:[MT] DVTPlugInLoading:无法加载插件com.apple.dt.dbg.DebuggerFoundation(/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin)的代码,错误=错误Domain = NSCocoaErrorDomain Code = 3587“无法加载捆绑包”DebuggerFoundation“,因为它已损坏或缺少必要的资源。” (dlopen_preflight(/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin/Contents/MacOS/DebuggerFoundation):未加载库:@ rpath / IBAutolayoutFoundation.framework / Versions / A / IBAutolayoutFoundation

So since my installation of Xcode 7.0.1 via the Mac App Store ended up being corrupted none of the suggestions by all the other helpful responders here were destined to work.

因此,由于我通过Mac App Store安装Xcode 7.0.1最终被破坏,所有其他有用的响应者的建议都没有注定要工作。

These things never crop up when you have plenty of time to throughly troubleshoot them. It certainly isn't that time for our release schedule right now, so what worked here (OS X 10.10.5, departing Xcode 6.4 for Xcode 7.0.1) was (and this is after having asked the App Store to reinstall 7.0.1)

当你有足够的时间彻底排除故障时,这些事情永远不会出现。现在肯定不是我们发布时间表的时间,所以这里有用(OS X 10.10.5,Xcode 7.0.1的Xcode 6.4)(这是在要求App Store重新安装7.0.1之后) )

rm -Rf /Applications/Xcode.app

Followed by asking the Mac App Store to reinstall Xcode 7.0.1

随后要求Mac App Store重新安装Xcode 7.0.1

Then we were able to proceed with updating CocoaPods, etc. etc. etc.

然后我们就可以继续更新CocoaPods等等。

#6


1  

sudo xcode-select -r fixed the issue

sudo xcode-select -r修复了这个问题

#7


1  

Everyone suggested an xcode problem, what solved it for me was removing all of cocoapods gems, then reinstalling them:

每个人都提出了一个xcode问题,为我解决的问题是删除了所有的cocoapods宝石,然后重新安装它们:

gem list | grep cocoapods | xargs gem uninstall -aIx
gem uninstall xcodeproj