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:56

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.

查看更多
The star\"
3楼-- · 2019-01-25 04:57

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.

查看更多
混吃等死
4楼-- · 2019-01-25 04:58

It worked for me after remove all folders in DerivedData folder.

查看更多
▲ chillily
5楼-- · 2019-01-25 05:01

Cleaning the project and restart xCode worked for me.

查看更多
女痞
6楼-- · 2019-01-25 05:01

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.

查看更多
叼着烟拽天下
7楼-- · 2019-01-25 05:03

Something that might help would be to set the Derived Data location to "Relative" in XCode preferences, then Clean & Build

XCode derived data location

查看更多
登录 后发表回答