2016-11-21 1 views
2

미스터리 링커 오류로 문제가 있습니다. 내 일반 대상 및 UITest 대상 빌드 및 잘 실행하지만 UnitTest 대상 항상 아래 오류와 함께 실패합니다. CoreData에 문제가있는 것 같지만 테스트 대상에서 오류가 발생하는 이유와 주 대상에서 오류가 발생한 이유를 알 수 없습니다. 나는 시도 : 1) 파생 된 데이터를 삭제. 2) xCode를 다시 시작합니다. 3) 깔끔하게 설치할 수 있습니다.Xcode 8 빌드 오류 UITests "직접 필드 오프셋"

문제가있는 부분에 대한 도움을 주시면 감사하겠습니다. 나는 혼란 스럽다. 감사! 항목 별 커밋 내를 통과하여

Undefined symbols for architecture x86_64: 
    "direct field offset for playolaIphone.AppDelegate.(managedObjectModel.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : __ObjC.NSManagedObjectModel?", referenced from: 
     playolaIphone.AppDelegate.managedObjectModel.setter : __ObjC.NSManagedObjectModel in MockAppDelegate.o 
     playolaIphone.AppDelegate.(managedObjectModel.materializeForSet : __ObjC.NSManagedObjectModel).(closure #1) in MockAppDelegate.o 
    "direct field offset for playolaIphone.AppDelegate.(managedObjectContext.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : __ObjC.NSManagedObjectContext?", referenced from: 
     playolaIphone.AppDelegate.managedObjectContext.setter : __ObjC.NSManagedObjectContext in MockAppDelegate.o 
     playolaIphone.AppDelegate.(managedObjectContext.materializeForSet : __ObjC.NSManagedObjectContext).(closure #1) in MockAppDelegate.o 
    "direct field offset for playolaIphone.AppDelegate.(persistentStoreCoordinator.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : __ObjC.NSPersistentStoreCoordinator?", referenced from: 
     playolaIphone.AppDelegate.persistentStoreCoordinator.setter : __ObjC.NSPersistentStoreCoordinator in MockAppDelegate.o 
     playolaIphone.AppDelegate.(persistentStoreCoordinator.materializeForSet : __ObjC.NSPersistentStoreCoordinator).(closure #1) in MockAppDelegate.o 
    "direct field offset for playolaIphone.AppDelegate.(applicationDocumentsDirectory.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : Foundation.URL?", referenced from: 
     playolaIphone.AppDelegate.applicationDocumentsDirectory.setter : Foundation.URL in MockAppDelegate.o 
     playolaIphone.AppDelegate.(applicationDocumentsDirectory.materializeForSet : Foundation.URL).(closure #1) in MockAppDelegate.o 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
+0

시도 : http://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option – shallowThought

답변

6

, 나는 SWIFT_WHOLE_MODULE_OPTIMIZATION 플래그로 아래로 추적. 이 설정을 프로젝트에서 삭제하면 해결되었습니다. 나는 왜 그런지 모르지만 나는 누군가를 돕기 위해 이것을 남겨 둘 것이라고 생각한다.

+0

최적화가 필요하므로 더 많은 수표가 필요합니다.이 수표는 그것. 기본적으로 코드에는 릴리스 앱의 예상치 못한 동작으로 이어질 수있는 버그가 있습니다. –