Could not build module UIKit

2019-01-25 04:20发布

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.

19条回答
兄弟一词,经得起流年.
2楼-- · 2019-01-25 04:46

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 Hope that this will help.

查看更多
Lonely孤独者°
3楼-- · 2019-01-25 04:48

Make sure none of the files are edited in the UIKit framework located inside Xcode.

查看更多
霸刀☆藐视天下
4楼-- · 2019-01-25 04:51

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.

查看更多
forever°为你锁心
5楼-- · 2019-01-25 04:52

Check whether the appropriate target is selected or not from active scheme selector. Selecting Generic iOS Device solved my problem.

Click to select simulator

enter image description here

Select Generic iOS Device

enter image description here

查看更多
Summer. ? 凉城
6楼-- · 2019-01-25 04:53

If you have two Xcode then uninstall both and again install Xcode.it works for me.

查看更多
淡お忘
7楼-- · 2019-01-25 04:55

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.

查看更多
登录 后发表回答