Ios 在Travis中编译时,xcodebuild退出,错误代码为65
我们目前正在将XCode项目设置为在Travis中构建和测试。 我们正在执行Ios 在Travis中编译时,xcodebuild退出,错误代码为65,ios,xcode,travis-ci,Ios,Xcode,Travis Ci,我们目前正在将XCode项目设置为在Travis中构建和测试。 我们正在执行pod安装,然后使用以下命令: xcodebuild clean test-workspace XXX.xcworkspace-scheme XXX-destination\“platform=iOS模拟器,name=iphone7\“code\u SIGN\u IDENTITY=\”\“code\u SIGNING\u REQUIRED=NO ONLY\u ACTIVE\u ARCH=NO 似乎无法从BNRCoreDa
pod安装
,然后使用以下命令:
xcodebuild clean test-workspace XXX.xcworkspace-scheme XXX-destination\“platform=iOS模拟器,name=iphone7\“code\u SIGN\u IDENTITY=\”\“code\u SIGNING\u REQUIRED=NO ONLY\u ACTIVE\u ARCH=NO
似乎无法从BNRCoreDataStack pod编译文件:
/BNRCoreDataStack/Sources/Bundle+CoreDataModelHelper.swift
,出现以下错误:条件绑定的初始值设定项必须具有可选类型,而不是“NSManagedObjectModel”
(然后以代码65退出)。查看这个类,我们可以看到,NSManagedObjectModel
的初始值设定项确实是可选的,因此我们不确定错误可能是什么
在本地机器上运行相同的命令可以正常工作
其他信息:我们正在使用xcode9和Swift 3.0
您能显示导致此编译器错误的实际代码吗?当然,刚刚编辑的原始问题非常有趣。您确定失败的编译使用的是完全相同的代码吗?也许有些东西被错误地优化了。我想知道如果代码被重写是否会更好。但我想你不能那样做。您可以将此问题提交给BNRCoreDataStack的作者。或者特拉维斯(我不确定)。或者苹果。是的,我们正在使用BNRCoreDataStack(2.2.1),本地和Travis都使用这个精确的代码。我们刚刚给Travis support发了电子邮件,如果运气好的话,我会更新这个问题。
import Foundation
extension Bundle {
static private let modelExtension = "momd"
/**
Attempts to return an instance of NSManagedObjectModel for a given name within the bundle.
- parameter name: The file name of the model without the extension.
- returns: The NSManagedObjectModel from the bundle with the given name.
**/
public func managedObjectModel(name: String) -> NSManagedObjectModel {
guard let URL = url(forResource: name, withExtension: Bundle.modelExtension),
let model = NSManagedObjectModel(contentsOf: URL) else {
preconditionFailure("Model not found or corrupted with name: \(name) in bundle: \(self)")
}
return model
}
}