Could not build module UIKit

前端 未结 24 1203
予麋鹿
予麋鹿 2020-12-17 07:59

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:

相关标签:
24条回答
  • 2020-12-17 08:21

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

    XCode derived data location

    0 讨论(0)
  • 2020-12-17 08:22

    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.

    0 讨论(0)
  • 2020-12-17 08:22

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

    0 讨论(0)
  • 2020-12-17 08:23

    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
    
    0 讨论(0)
  • 2020-12-17 08:24

    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.

    0 讨论(0)
  • 2020-12-17 08:25

    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.

    0 讨论(0)
提交回复
热议问题