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:
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.
Cleaning the project and restart xCode worked for me.
In my case, after cleaning the project, only restarting my Mac helps.
Cleaning Derived data worked for me
Make sure none of the files are edited in the UIKit
framework located inside Xcode.
Please don't make the same mistake like I did. In my case, I accidentally typed some words into Foundation framework file.