简体   繁体   中英

Error generating pods project - Pod install

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

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.

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

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:

gem install xcodeproj -v 0.24.3

(may have to sudo that)

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

Try running this in terminal:

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

Then try your CocoaPods install again:

pod install

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

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

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) :

sudo gem update

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

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)

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

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

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.

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)

rm -Rf /Applications/Xcode.app

Followed by asking the Mac App Store to reinstall Xcode 7.0.1

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

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM