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:
Something that might help would be to set the Derived Data location to "Relative" in XCode preferences, then Clean & Build
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.
It worked for me after remove all folders in DerivedData
folder.
I accidentally edited the Foundation framework file
so UIKit.framework
got corrupted. The only solution is recover the original.
You have two solutions: 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
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.
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.