ChatGPT解决这个技术问题 Extra ChatGPT

Why am I getting ibtool failed with exit code 255?

All of a sudden I can't build my project. I get the following compiler error:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool failed with exit code 255

I get this error for a whole bunch of my xib files. Any ideas what is happening, and what a solution is?

Using Xcode 4.6, iOS 6.1.

Can you roll back the XIBs? Are you using source control like git to see what changed in the xib "all of the sudden"?
@bryanmac I am using git, but the issue was in many of the xib files, many of which I hadn't touched. The issue seems to have been an Xcode glitch that was either solved by restarting Xcode multiple times or by switching around to different simulators, as suggested in the accepted answer.
Just one try clean your code and run.
I had a beta of Xcode 9 running, which I'd closed. I forgot to close the beta version of simulator. When I opened Xcode 8, I got this error when trying to build and run the app. Closing the beta version of simulator, clean cache, and rebuilding resolved the issue.
This happened when I deleted some files from the ~/Library folder

F
Flexo

I had something similar happen to me recently using Xcode 4.6 and iOS 6.1.

All I did was switch to a different device version (5.1) on the simulator and it ran. Switched back to 6.1 and it fixed itself.

Xcode can be unhelpful at times.


I had already tried this, but I tried it a few more times, and it eventually solved the issue.
4.6.1 just came out today. Maybe this update will fix this issue.
at times? This is my productivity today: I am working for 6 hours straight. 15 minutes creating code, 5:45h fighting xcode and I am no where near solving this problem yet. Man I hate Xcode. Is the worse software I ever worked with.
Xcode sometimes reacts funny. I was having the same issue... tried a few times and it eventually get solved by its own.
Just got this with the update to Xcode 9.3. I'm developing with xamarin, so not using Xcode beyond the compiler. What solved this for me was to actually boot xcode and get prompted to "install required components". After that was complete, I could rebuild my project and did not see this error again.
d
damithH

This happen to us and we clean cache, delete Derived data folder.. etc. nothing happen.

below steps made it fix,

open xib(nib) as Source Code (Right click on the xib Open As > Source Code from Xcode or open it using TextEdit) remove this appearanceType="aqua" save and open using Xcode

For more explain use this article, it help us to fix the issue.


there is no field appearanceType="aqua" occurs in my code. How should I resolve this
@abc just search for "appearanceType" and remove that line
U
Undo

Try cleaning the app. Cmd-Shft-K.


k
knagode

Try to find all XIB files in project and open it. One of them will most likely crash your Xcode.

My problem was custom fonts in some XIB file.

I had to install missing fonts on my computer and problem was solved.


For me the issues was with storyboard.
For me issue was with Derived data
V
Vikram Belde

Restart Xcode - Didn't Work Cleaning the App - Didn't Work Deleting the derivedData - Didn't Work Reset simulator content and settings - Didn't Work changing simulator versions - Didn't Work Restart the OS - Magically Works

I'm not sure which part did the magic and yes it killed a lot of time.


N
Nirmal Subedi

In my case, I was working on Visual Studio. It was all good. All of a sudden, I got the same issue. Then I opened XCode, I saw the updates available. Then I Updated the Xcode updates. Then it worked :)

So the reason was : XCode expected to complete some updates. Until that, It was not working properly.

https://i.stack.imgur.com/ieSVA.png

https://i.stack.imgur.com/JFPxW.png


This is what helped fix it. Thanks!
0
0llie

What you should do if you're stuck is, in a shell: ibtool --warnings --errors --notices yourfile.xib > alerts.plist

which will crash, but now you have the crashlog, in my case it was an issue with simulated metrics:

localhost:Classes me$ ibtool --warnings --errors --notices CodeViewController.xib > alerts.plist 2014-04-25 17:40:48.625 ibtoold[11691:507] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-5038/InterfaceBuilder/WidgetIntegration/SimulatedMetrics/IBUISimulatedSizeMetrics.m:33 Details: (initialTargetRuntime) should not be nil. Object: Method: -initWithTargetRuntime: Thread: {name = (null), num = 1} Hints: None

So in my case I opened the xib as source via context menu and removed the metrics objects. It depends on the error what to remove or change. Try ibtool again and if it doesn't crash you're good.

Background: The reason for this error is generic, it can always happen with different specs changing from iOS xcode version to version, mostly if you haven't checked your projects periodically with xcode updates.


This error happens due to any of the new not supported feature in IB. Hence this is the perfect answer. Great answer. +1
L
Logan

This will be irrelevant for those who had experienced the problem in the past... But with the WatchKit Framework, I had this error come up. All I did was delete a segue which I had linked between two WKInterface Controllers, and the build succeeded.


I am beginning to this problem is more related to segue or something. I was working on old branch and my boss changed lot of stuff on storyboard. I only get version version conflict when I am merging but after merge it. no matter which side I picked in conflict resolution. It get to the same error. :(
n
nenchev

I go this error, and after scanning the crash log I noticed out my Xcode-7 build was trying to use the build tools from Xcode-8 Beta. I had previously used xcode-select to change the version of the build tools I wanted to use. If you have a xcode-beta install, check your settings using the commands below:

Show which build tool path is set:

xcode-select -p

Select the standard Xcode path:

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

If you're trying to build with an Xcode at different installation path, be sure the path above reflects that.


C
CodeBender

Got this just now with XCode 8.3.

For me, I just quit XCode, then cleaned the app and rebuilt. It was fine after that.

The cause for me was adding new string files for a localized storyboard.


A
AWrightIV

I just experienced the same thing and none of the other answers here could resolve the issue for me. It turned out to be a duplicate UILabel in the storyboard due to a git merge. Apparently Xcode will crash if two UI elements have the same internal ID.

My method for finding the responsible issue was:

Iteratively step backward through the git history, checking out each commit until you find the first storyboard that doesn't crash Xcode.

Once you have the commit that started crashing, check out HEAD and iteratively revert the storyboard changes in the problem commit. Continue to narrow it down until you have the one UI element or one line that will cause a crash.

Revert the responsible change permanently and restart Xcode. Open the storyboard again and you may be warned about an internal inconsistency. Agree to the proposed changes Xcode makes, but review them.

If necessary, you may now attempt to re-create the UI element or changes from scratch that were causing the problem before.


F
Frederick C. Lee

I was working within a secondary git branch when I encountered the '255' problem.

I merely switched back to my main git branch, cleaned the project and run. No problems as I had expected.

Then I switched back to the 'problem' git branch and rebuild it with success.

Gremlins.


K
Kazak

I had something similar happen to me too using Xcode 8.2.1 and iOS 10.2.

I switched to an earlier device version on the simulator and it worked. Then I switched back and it was fixed.


C
Community

I figure out that if you use Xcode for too long without closing it, Xcode will become ultimately unhelpful and giving you random mystery error. so i regularly restart Xcode and all the apps that I`m running on my mac every time a suspicious error appear.

Xcode Cache 1st try check all your segue/outlet/storyboard controller class. sometime storyboard would disconnected with the view controller class that has been set. (this might cause run time error). 2nd try cleaning up you project and goto (~/Library/Developer/Xcode/DerivedData) and delete your project cache. then Force Close Xcode then restart it. 3rd try check all your segue/outlet/storyboard controller class. sometime storyboard would disconnected with the view controller class that has been set. (this might cause run time error). 4th try check (copy bundle resource, compile source - Project > Build phase) make sure the file listed is exist with the correct address and folder. sometime creating a group would cause a folder to be create and causing the file cant be found by the compiler 5th this also might been cause by moved file + Xcode become ultimately unhelpful and giving you random mystery error. and dint update the (copy bundle resource, compile source - Project > Build phase) after the file has change directory Personal Mistake. unintended deleting this also might have been cause by calling an deleted ViewController or outlet


Under Project File > Build Settings > iOS Deployment Target it shows only numbers, no "Latest Version". Setting to iOS 11, then to iOS 9 and then back to iOS 11 had no effect. Version 9.0 (9A235)
@WilliamCerniuk from the date i post this answer, I figure out that if you use Xcode for too long without closing it, Xcode will become ultimately unhelpful and giving you random mystery error. so i regularly restart Xcode and all the apps that i`m running on my mac every time a suspicious error appear.
@WilliamCerniuk try cleaning up you project and goto (~/Library/Developer/Xcode/DerivedData) and delete your project cache. then Force Close Xcode then restart it.
@WilliamCerniuk try check all your segue/outlet/storyboard controller class. sometime storyboard would disconnected with the view controller class that has been set. (this might cause run time error).
@WilliamCerniuk try check (copy bundle resource, compile source - Project > Build phase) make sure the file listed is exist with the correct address and folder. sometime creating a group would cause a folder to be create and causing the file cant be found by the compiler
A
Alessio Di Salvo

I have had the same issue using Visual Studio for Mac (Community, 7.4.2 (build 12)) after an OS update (macOS High Sierra 10.13.4).

In this case, it seems that you just need to update Visual Studio and Xcode.

Notice that, of course, Visual Studio doesn't bring Xcode updates, so the "trick" was to open the latter one and let it run the updates.


This was my problem as well - launching xcode prompted me to reinstall required components and fixed it.
Updating to iOS 12.0, happened the same to me. It was just necessary to run XCode for the first time, to let it install some extra components and finished!
A
Abirami Bala

I was also facing the same issue in Xcode 8. Deleting the Derived data fixed my issue.

Go to Folder ~/Library/Developer/Xcode/DerivedData/ and clear the folders within that Restart Xcode and Simulator and Run Your project....!


Did not work deleting derived data for the project nor deleting ~/Library/Caches/com.apple.dt.Xcode (a commonly corrupted cache)
W
WCByrne

Just had this happen after doing some work in the storyboard. I did some undoing and it turned out to be a simple UIButton added to a view. Deleted that and it built without error. Just added a new button and it worked.

For a little more explanation... The button had been copied from one TVCell prototype to another. some confusion happened in the copy I guess. Just glad I hadn't change much before trying to build.


D
Daniele D.

In my case it happened after renaming some namespaces and I solved the same issue going to the projects properties > APPLICATION tab > Default namespace : giving the new correct namespace.

Of Course I changed the namespace also inside the classes, but this will help because will fix all auto-generated files. Clean and build is recommended and eventually close and reopen the solution.


A
Anand Mishra

I faced same issue when i merge code form git with other developer code. i tried many time to clean my project. But nothing help me out.

I open storyboard in source code. Start comparing with last working repositories storyboard. Then i found a same label appear two time in same screen. then i remove one of then and save. It helps me.

you can check your xib or storyboard.


L
Lord Zsolt

I had this bug because I rewrote a <view> to <imageView> while editing the storyboard as source code.

I thought this quick-and-dirty solution would work for replacing some custom classes (subclass of UIView) with UIImageViews.

All praise GIT.


G
GhostCode

This is what caused the problem for me: I had attempted to use the iOS 8.0 simulator with Xcode 5.0.2. I had pasted iOS 8.0 simulator in the following path - /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs The result of this was that I was able to see iOS 8.1 simulator visible in the dropdown list in Xcode 5.0.2 but this resulted in compilation error of libtool. I removed the simulator from the path and it worked after i restarted Xcode. Now in order to use iOS 8.0 simulator I am using Xcode 6.1


P
Pedro.Alonso

I fixed the error with this command, close the simulator and Xcode:

codesign -vv /A*/Xc* | open -ef

Hope that helps.


How codesigning is related to this. when I am just trying to build on sim
C
Community

I was getting this error when building for 10.9 an .XIB that was created in XCode 6.4 (10.10).

See this answer. The XIB was calling for 'labelColor' which was introduced in 10.10, and was unknown to 10.9.

Opening the XIB as source kept it from crashing XCode, and permitted me to change instances of 'labelColor' to 'textColor' and the error was resolved.


J
Jim Rota

As Logan Geefs mentions above, it appears to be caused by Interface Controller segues (i.e. loops). Deleting the "bad" segues doesn't really solve the navigation problem. What is needed is to place some button actions to [pop controllers] strategically.

Here's the code that worked for me:

 - (IBAction)backToStart {

   [self popToRootController];
 }

 - (IBAction)backToPrevious {

   [self popController];
 }

S
Sam Bing

Few have mentioned that the problem was related to segues, mine was too, although it did not pop up immediately after i added the new segue and i was able to run the app a few times make some changes, add new views before it occurred, so don't disregard this. I went deleting some of the controllers and undoing in case it didn't help. If a segue is the issue you may build but you wont be able to add that segue, so re-create the entire view controller if it's a viable option. Copying and pasting didn't seem to work, though i did not try removing the IBOutlet connections.


S
Stewart Lynch

This started to happen to me when I installed and started using XCode 9 betas. When I started modifying good projects in 8.3, the storyboards got corrupted with this error and XCode crashed. I had XCode 7.x, 8.3 and 9 installed on my computer. I uninstalled all of them (and removed all related files) and then reinstalled 8.3 from the App Store. My project storyboards were still corrupted, but I was able to recover from backup and now things are just fine as I proceed. Not sure if this is 9 beta related or not.


K
Kabeer

In my case, I had this issue after I manually resolved a merge conflict in the "project.pbxproj" file. In XCode, select project->target->BuildPhases->CopyBundleResources. There I removed some duplicate files that were showing up in blank icons (unlike the XIB file icons). AFter this, the build went well without issues.


T
Tim Kofoed

I got this error today on a new project, testing iOS' ARKit via the "Augmented Reality App" project template.

After moving some .scn files from the root project into the art.scnassets folder, I started getting the code-sign error, and nothing I did was able to resolve it.

I tried all the suggestions in this thread (clean, clean derived data, restart Xcode, restart the Mac, look in the storyboard files for duplicate IDs)... but what made it work for me, was to:

commit and push my changes to my git project

hard-reset to the previous commit

clean derived data, and run successfully

hard-reset back to the most recent commit

...and now it worked... so I'm guessing it was some error in XCode's git-handling???


W
Warren P

On XCODE 9 one cause of this is a bug in XCODE 9.1 with old .XIB files.

Fix:

Upgrade to XCODE 9.2 All your .XIB files should be set to iOS 8.1 version or higher.


S
Sunil Targe

Just clean build your project. you'll get Solved!