简体   繁体   中英

iOS command line build fails (Jenkins, Xcode 6.1, Storyboards)

I am trying to build my iOS project in Jenkins. This is how the Jenkins job is set up:

  1. Source is fetched from git repo (Git plugin)
  2. External libs are updated via CocoaPods (CocoaPods plugin)
  3. XCode build is started (Xcode plugin, specified target, schema, workspace file and build output directory. "Pack application and build .ipa?" not active for this test.

One and two are working fine, step three fails:

Validate build/MyApp.app
    cd "/Users/myuser/.jenkins/workspace/MyApp Beta"
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export PRODUCT_TYPE=com.apple.product-type.application
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Users/myuser/.jenkins/workspace/MyApp\ Beta/build/MyApp.app

** BUILD FAILED **

Build step 'Xcode' marked build as failure
Finished: FAILURE

The only error that I can see occurring before that is the following:

CompileStoryboard MyApp/Base.lproj/Main_iPhone.storyboard
    cd "/Users/myuser/.jenkins/workspace/MyApp Beta"
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --target-device iphone --errors --warnings --notices --module MyApp --minimum-deployment-target 7.0 --output-partial-info-plist /Users/myuser/Library/Developer/Xcode/DerivedData/MyApp-ddibhvvpirpyiwdhzlmbkpcqbjvq/Build/Intermediates/MyApp.build/AdHoc_Distribution-iphoneos/MyApp.build/Main_iPhone-SBPartialInfo.plist --auto-activate-custom-fonts --output-format human-readable-text --compile /Users/myuser/.jenkins/workspace/MyApp\ Beta/build/MyApp.app/Base.lproj/Main_iPhone.storyboardc /Users/myuser/.jenkins/workspace/MyApp\ Beta/MyApp/Base.lproj/Main_iPhone.storyboard
nwi_state: registration failed (1000000)
2014-12-16 22:03:44.263 Interface Builder Cocoa Touch Tool[8241:7877572] ***createStorageTaskManagerForPath:withIdentifier failed: Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection to service named com.apple.nsurlstorage-cache was invalidated.) UserInfo=0x7fca32cd3c70 {NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; {
    NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";
}
nwi_state: registration failed (1000000)
2014-12-16 22:03:46.899 Interface Builder Cocoa Touch Tool[8270:7877686] ***createStorageTaskManagerForPath:withIdentifier failed: Error Domain=NSCocoaErrorDomain Code=4099 "The operation couldn’t be completed. (Cocoa error 4099.)" (The connection to service named com.apple.nsurlstorage-cache was invalidated.) UserInfo=0x7fd1d9f06040 {NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; {
    NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";
}

I didn't find anything helpful on this error, but I guess this is what is failing the build process. The app builds fine in Xcode. When I paste the ibtool command and execute it directly I am getting the exact same error as Jenkins.

Do you know what could be causing this error and how I can get rid of it?

That might be duplicated resources in the project file. Open the .xcodeproj in the text editor such as Sublime or Text Wrangler and carefully remove all duplicated xib or storyboard references.

另外,请确保Mac Slave上安装了正确的Xcode版本,在我的情况下,我有一个带有SafeArea的故事板,但Xcode版本是旧版本来编译它。

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