Xcode Crashes when adding UIViewController in Interface Builder - ios

I was in Xcode and I went to edit a nib file. I tried to drag on a UIViewController from the objects library, but as soon as I did Xcode crashed. I had never had this problem before, but now I cannot add a UIViewController to the nib file (the problem persists for other files in the same project and other files in other projects).
Originally, the problem occurred in the Developer Beta of Xcode 4.5 that I was using, but now when I tried in the old version of Xcode the problem was there also.
Basically, I have been unable to find a way to get this problem to stop. If anyone has experienced this problem or knows how to fix it, that would be so great.
Thanks,
Luke

What about trying to delete all Xcode preferences files? It seems like the latest Xcode beta broke something there...
Have a look at the following folders:
/Users/xyz/Library/Application Support/Developer/Shared/Xcode
/Users/xyz/Library/Application Support/Xcode
/Users/xyz/Library/Developer/Xcode
/Users/xyz/Library/Caches/com.apple.dt.Xcode

Related

Could not build module 'Foundation', 'UIKit, 'CoreFoundation' on Xcode 9.3 and Xcode 9.4 [duplicate]

Suddenly it stops building application in device. In simulator its working but when I connect the device and try to run it in device it gives me an error:
Could not build module UIKit
I tries a lot but couldn't solve it.
A full clean + deleting the derived data worked for me.
Be sure to fix any code that may be broken because UIKit cannot be installed, before the clean and build.
So, for example, if you are trying to reference UICollectionViewController, and need UIKit to reference it, comment out the code that is using UICollectionViewController, comment out the import for UIKit.
Then clean, build. Now uncomment import UIKIt, build. NOW uncomment UICollectionViewController code, build again.
Please don't make the same mistake like I did. In my case, I accidentally typed some words into Foundation framework file.
Something that might help would be to set the Derived Data location to "Relative" in XCode preferences, then Clean & Build
For some reason your UIKit.framework is corrupted, either copy a working UIKit.framework from somewhere else into
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks
Or reinstall Xcode the fix the issue.
I accidentally edited the Foundation framework file
so UIKit.framework got corrupted. The only solution is recover the original.
You have two ways to achieve the same:
Just reinstall Xcode. OR
copy the Framework from another machine with the same XCode version and paste into yours.
Location:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks
If you have two Xcode then uninstall both and again install Xcode. It worked for me.
If cleaning the project and deleting the 'derived data' doesn't work,
try to change the 'Deployment target' (at 'General' tab) from 7.0 to 7.1
Check whether the appropriate target is selected or not from the "active scheme selector". Selecting "Generic iOS Device" solved my problem.
Click to select simulator
Select "Generic iOS Device":
Make sure none of the files are edited in the UIKit framework located inside Xcode.
Cleaning Derived data worked for me
Check the tool chains installed and select the right xcode tool chain. In my case i changed it from Swift 4.0 to xcode 9.2 and it worked.
In my case, after cleaning the project, only restarting my Mac helps.
Cleaning the project and restart xCode worked for me.
I am also facing this issue for very long time and after trying all the suggestions given in the different portals, i came to know that the issue is with the device you want to run the application. Device have latest iOS and your Xcode is not supporting that iOS.
For example you have Xcode 7.2 and want to run the application on device which have iOS 9.2.1. So you only need to update your Xcode.
And one more thing Base Sdk in Build Settings is always greater or equal to the software version number on your development device.
Already tried all the solutions above. I still could not solve my problem. So I uninstall the Xcode and reinstall it. It worked magically.hope this helps.
Suppose you have changed or deleted anything in the UIKit framework, then shows this error.
If you are able to find that class or .h file to be changed or deleted, then replace that whole file content in that .h file from other system's Xcode (confirm that should be similar Xcode version).
For example, In UIView.h file - I have deleted a method and closed and opened the Xcode. Then I couldn't reverted that code.
I tried with delete derived data,delete application from project list but when i delete xcode and install new one its working so its best way just delete xcode and install new xcode.
This error happened to me when I accidentally modified the uikit framework. Removing and re-adding the uikit framework in link binary with library, cleaning derived data and restarting xcode didn't work. I don't want to uninstall my xcode so I tried to copy codes of the class that I might have modified from other pc with xcode that works fine and paste it to mine. It worked!
If your project builds for another target (e.g. it builds for simulator and NOT your device), then it's confirmed you accidentally edited one of the header files of the frameworks for that target. The affected framework is the one you are receiving compiling errors for.
It worked for me after remove all folders in DerivedData folder.
My Issue causing this same error was due to working in a workspace created by coco pods, somehow the link to the UiKit Framework had been lost from the original project.
To solve this i just reopened the xCode project not the workspace and re added the missing UIKit framework, saved the project and closed it, re opened my workspace for the project and the annoying nag messages caused by this were fixed. Hopefully this helps someone else.
I had this issue, and I set Device on Generic iOS Device, clean project, make build. Then I switched device to my real device and run project. The error does not appear.
Cleaning some unnecessary Xcode data using DevCleaner for Xcode app worked for me.
My error was a wrong version of command line tools - go to Preferences->Locations and change the command line tools version - quit xcode and try again.

Sticker Pack Interface Builder Storyboard Compiler Error Group

WWDC 2016 came up with a new concept of creating Sticker Pack & push it to store from iOS10 onwards. I downloaded XCode 8 Beta, & tried to create a sticker pack app for the message extensions.
I did everything as explained but on building the project I am getting error
Interface Builder Storyboard Compiler Error Group
Strange thing is for Sticker Pack we don't need to write any code, but still it is showing error of Interface Builder.
I am getting this error under build time
I have also reported this to apple, but would like to know if anyone has any idea to remove this & execute my code.
In my case, I rename application xcode-beta to xcode 8.0b in finder. After what IDE cann't open any xib and storyboard.
Solution: don't rename app.
I found the solution:
When you will download the Xcode-beta & when you will unzip the .xip file, the xcode-beta will present in same folder where the min file is downloaded, strange thing is that apple is not automatically pushing xcode-beta to Application folder.
If you are experiencing the same issue, push the xcode-beta executable to Applications folder, & execute your project from there & you will find that it will work like charm.
Got it working finally. In my case, Xcode was there in the Applications folder, but for some reason it was named "Xcode-beta 2". Renamed it to "Xcode-beta", restarted the application, cleared derived data, and it started working.

Swift: Thread 1 signal SIGABRT

After upgrading Xcode from 5 to 6 beta, almost every project gives me an unexpected error after running the application. There are some other posts with this title but the error is different.
In AppDelegate.swift, sometimes the simulator goes completely black, without the error, sometimes it gives me the error on this line:
class AppDelegate: UIResponder, UIApplicationDelegate {
In Xcode 5 I didn't had this error before, with Deployment Target set to 7.0 or 7.1.
Thanks in advance.
This error is caused when you have 2 or more of the same IBOutlets or IBActions in your main.storyboard inspector (right arrow key at the very end of your options). Find out where there is double, and delete the one you don't need! It should work perfectly fine after that.
Seems like there was a bug with iOS 7.1 as target.
Running tests on devices with iOS 7.1 installed now works. (17028705)
Try it again with the beta 2 update
I found this issue happened when I linked #IBOutlet/#IBAction and the linkage broke (renaming for instance). In the main.storyboard inspector, right click (control click) on the elements and delete any bad linkages. Should fix the error if that's the issue.
(Xcode 7)
fix my problem:
Go to deployment info and in "Main interface" select your correct storyboard...
Rerun app.
My issues with this started after I installed the legacy simulators (iOS7.1) under 'More Simulators' under the simulator build target. Xcode 6 and its native simulator had been running fine until then. What fixed it for me was to close Xcode, delete Derived Data, and under iOS Simulator in the simulator application choose "Reset Content and Settings" then restart the system.
I'm new to the coding world but resolved the painstacking problem. I was getting the same error by doing something and even though i deleted everything around that i couldn't resolve it. It was still giving me the same error, which meant that it is not deleting in some file it stores. Took me a while to figure out which file, finally when i opened the Mainstoryboard as source file, and did search on the error key word which i knew i changed, it gave me the lines it was sitting in. After deleting those lines error got fixed. I know basic HTML so i knew which lines to delete.
I cannot start my project all over again everytime i have this error so i had to find the solution and there was no solution i could find. So i had to do it myself with common sense, as i said i have no knowledge of coding.
Hope it helps.
I know there's already plenty of answers but just to note what happened in my case:
I created the ViewController on the storyboard first and then I created the class, I don't know why this was an error because both class names where identical, but by rewriting the class name on the storyboard helped to "link" correctly the view controller and its file. First create file then ViewController on storyboard to prevent this error.

Xamarin Studio. Monotouch. Could not load NIB in bundle ... with name

When I test the app on the simulator, I get the following:
Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: 'NSBundle <...> (loaded)' with name '...Controller'
But when I use the actual device everything is fine.
Any ideas?
Deleted all the controls in the xib, made my UI fully generated in code. Did not help.
Deleted both .cs and .xib files, created a new iphone controller, pasted the code. Still did not help in spite of the new empty xib!
Renamed my controller class name. Reinstalled the app in simulator. Resolved!
PS. I tried reinstalling the app before step 1. And that did not help. So I do not know what exactly resolved the problem.
In your Info.ptlist , check if your "Main Interface" is correct
Using Xamarin Studio on the Mac, I got this error. Also my iOS emulator was acting kind of strange too...I first cleared the programs and settings from the emulator, but that didn't help. So then I just rebooted the Mac. This solved the problem.
I was having the same problem - what fixed it for me was to make sure that under Properties, the .xib file had a build action of 'InterfaceDefinition' (instead of 'None').
Apparently this is a bug in Xamarin Studios, I contacted support and they said that they know about it and its going to be fixed in the next release.
They sent me this link https://files.xamarin.com/~jeff/XamarinStudio-4.2.4.243.dmg which didnt work for me. i tried everything , reinstalling simulator and even reinstalled xcode. But what worked for me was deleting and reinstalling Xamarin Studios. then it all worked again. still not sure whats going. Hope this helps others with same issue cause i know its a big issue on the Xamarin Forums.
sebastian says;
If you want to use the older Xamarin.iOS (7.0.7.2) then you need the older Xcode (5.0.2).
I had the same problem. Changing the Storyboard Id for the ViewController specified in error to something else in Xamarin's iOS designer solved the problem for me.
Deleted bin and obj folders and restarted Rider, working for me now.

XCode can not open .xcworkspace but AppCode can [cause CocoaPods]

I used CocoaPods in my project, after creating the project it can be opened by both XCode and AppCode correctly, then I wrote the code in AppCode for a few days, today I want to use XCode to open the .xcworkspace file but fail,XCode just displayed .xcodeproj file , I can not watch the whole project. Anyone meet the same problem?
I had a similar issue. The issue was that all toolbars and panels were hidden. In XCode Went to View > Show Toolbar etc. which fixed it.
Might not be the same problem but worth mentioning I think.

Resources