Reputation: 8710
I am stuck with this error on a Xcode project which was built last year in Xcode 8 and now I am trying to open it in Xcode 9 GM.
EDIT on double checking, I noticed it wasn't using GM, I was using Xcode 9.1 beta 2. The solution below works!
Error:
/Users/XXXX/Documents/App Development/Final Apps/XXXX/Base.lproj/Main.storyboard: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/ln/n28_nbyn2cg9_5dfqfsj8_7w0000gn/T/IB-agent-diagnostics_2017-10-04_21-24-39_279000".
I have tried the suggestions from other similar posts:
If I go to the folder error message is directing to, I see contents as:
CoreSimulatorLogs Document.storyboard Log.txt system.log
In the Log.txt, I see this:
Failed to compile nib consisting of IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBProxyObject, IBUIBarButtonItem, IBUIBarButtonItem, IBUIBarButtonItem, IBUIBarButtonItem, IBUIBarButtonItem, IBUIBarButtonItem, IBUICollectionViewController, IBUINavigationBar, IBUINavigationBar, IBUINavigationBar, IBUINavigationBar, IBUINavigationBar, IBUINavigationController, IBUINavigationController, IBUINavigationController, IBUINavigationController, IBUINavigationController, IBUINavigationItem, IBUINavigationItem, IBUINavigationItem, IBUINavigationItem, IBUINavigationItem, IBUIStoryboardEmbedSegueTemplate, IBUIStoryboardEmbedSegueTemplate, IBUIStoryboardShowSegueTemplate, IBUITabBar, IBUITabBarController, IBUITabBarItem, IBUITabBarItem, IBUITabBarItem, IBUITabBarItem, IBUITabBarItem, IBUITableViewController, IBUIViewController, IBUIViewController, and IBUIViewController.
Exception name: NSInvalidArgumentException
Exception reason: System-provided UIImage instances cannot be encoded in NIBs - raised for instance '<UIImage: 0x7f945db51a90>, {18, 20}'
Exception backtrace:
0. CoreFoundation 0x000000010800d023 __exceptionPreprocess
1. libobjc.A.dylib 0x0000000106de3f41 objc_exception_throw
2. IBCocoaTouchToolFoundation 0x0000000103071a8a -[IBCocoaTouchToolNibFactory nibCoder:willEncodeObject:]
3. IBCocoaTouchToolFoundation 0x0000000103071b77 -[IBCocoaTouchToolNibFactory nibCoder:willEncodeObject:forObject:forKey:]
4. UIKit 0x00000001038111f5 -[UINibEncoder replacementObjectForObject:forKey:]
5. UIKit 0x0000000103811d4d -[UINibEncoder encodeObject:forKey:]
6. UIKit 0x0000000103a4a6de -[UITabBarItem encodeWithCoder:]
7. UIKit 0x0000000103811ea0 -[UINibEncoder encodeObject:forKey:]
8. IBCocoaTouchToolFoundation 0x000000010305ed41 -[UIViewControllerTemplate encodeWithCoder:]
9. IBCocoaTouchToolFoundation 0x0000000103055018 -[UINavigationControllerTemplate encodeWithCoder:]
10. UIKit 0x0000000103811ea0 -[UINibEncoder encodeObject:forKey:]
11. UIKit 0x0000000103811354 -[UINibEncoder serializeArray:]
12. UIKit 0x0000000103811ea0 -[UINibEncoder encodeObject:forKey:]
13. IBCocoaTouchToolFoundation 0x000000010305ef3c -[UIViewControllerTemplate encodeWithCoder:]
14. IBCocoaTouchToolFoundation 0x00000001030704d9 -[UITabBarControllerTemplate encodeWithCoder:]
15. IBCocoaTouchToolFoundation 0x0000000103071e57 -[UIClassSwapper(IBHooksFor6767205) designTimeEncodeWithCoder:]
16. UIKit 0x0000000103811ea0 -[UINibEncoder encodeObject:forKey:]
17. UIKit 0x0000000103811354 -[UINibEncoder serializeArray:]
18. UIKit 0x0000000103811ea0 -[UINibEncoder encodeObject:forKey:]
19. IBCocoaTouchToolFoundation 0x000000010307166c -[IBCocoaTouchToolNibFactory encodeNibContentWithCoder:]
20. IBCocoaTouchToolFoundation 0x0000000103071801 -[IBCocoaTouchToolNibFactory nibDataWithMinimumCompatibility:]
21. IBCocoaTouchToolFoundation 0x0000000103071d43 +[IBCocoaTouchToolNibFactory nibDataFromObjects:customClasses:topLevelObjects:traitStorageLists:accessibilityConfigurations:connections:keyValuePairs:visibleWindows:minimumCompatibility:]
22. IBCocoaTouchToolFoundation 0x00000001030379d5 -[IBCocoaTouchTool compileNibForRequest:minimumCompatibility:layoutInfo:imagesToImageNames:]
23. IBFoundation 0x000000010640009b __80-[IBMessageReceiveChannel deliverMessage:toTarget:withArguments:context:result:]_block_invoke
24. IBFoundation 0x00000001063ffe98 -[IBMessageReceiveChannel deliverMessage:toTarget:withArguments:context:result:]
25. IBFoundation 0x00000001063ff80a __88-[IBMessageReceiveChannel runBlockingReceiveLoopNotifyingQueue:notifyingTarget:context:]_block_invoke
26. libdispatch.dylib 0x000000010cf352b5 _dispatch_client_callout
27. libdispatch.dylib 0x000000010cf40999 _dispatch_sync_thread_bound_invoke
28. libdispatch.dylib 0x000000010cf352b5 _dispatch_client_callout
29. libdispatch.dylib 0x000000010cf3f496 _dispatch_main_queue_callback_4CF
30. CoreFoundation 0x0000000107fcfd79 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
31. CoreFoundation 0x0000000107f94422 __CFRunLoopRun
32. CoreFoundation 0x0000000107f93849 CFRunLoopRunSpecific
33. Foundation 0x00000001067dfe5e -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
34. IBFoundation 0x00000001063c1cf5 -[IBAbstractPlatformTool startServingReceiveChannel:]
35. IBFoundation 0x00000001063c1fb0 -[IBAbstractPlatformTool startServingWriteDescriptor:readDescriptor:]
36. IBFoundation 0x00000001063c2ac9 +[IBAbstractPlatformTool main]
37. ??? 0x0000000102f9aba7 ???
38. libdyld.dylib 0x000000010cfa9d81 start
Exception info:{
}
I have no idea how to proceed. Any suggestions?
What does this error mean?
System-provided UIImage instances cannot be encoded in NIBs - raised for instance '<UIImage: 0x7f945db51a90>, {18, 20}'
Upvotes: 2
Views: 1204
Reputation: 3323
It's bit counter intuitive but full reboot only helped. No clean, delete derived data or new storyboard helped
Upvotes: 0
Reputation: 3015
From the Xcode 9.1 beta 2 Release Notes :
Interface Builder
A UITabBarItem configured as a system item in a storyboard or xib causes a build failure. (34197132)
Workaround: Configure as a custom item in Interface Builder, then reset the tab bar item to the desired system item in the awakeFromNib method of the view controller.
I've had the same issue as you have and this seems to be the cause since the log pointed to one of my UITabBarItems.
EDIT: I can confirm it works. Change all your system TabBarItems to custom and it will compile! EDIT2: Are you sure you're not using 9.1 beta? Because I've never had this issue before today, when I tested Xcode 9.1 beta 2 (after previously using Xcode 9).
Upvotes: 4
Reputation: 1657
Clearing out the DerivedData folder (in ~/Library/Developer/Xcode/DerivedData) is what fixed the issue for me.
Upvotes: 0