xcode8 beta 5 archive failed - swift compile error

I just create a total new template project and try to archive it ( I didn't write any code, just create a project by default), choose the generic ios device, but many swift compile error appeared , the build and run in simulators are definitely normal, the error are like below:


/Users/apple/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityViewController.h:18:85: Attempting to use the forward class 'UIViewController' as superclass of 'UIActivityViewController'


/Users/apple/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertController.h:33:60: Attempting to use the forward class 'UIViewController' as superclass of 'UIAlertController'


Does anyone meet this issue?


I am grateful for anyone to give me some clues to solve this.

Replies

Are you using beta 5 or beta 6? Your post says the former in the subject and the latter in the tags )-:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Both beta5 and beta6 has this problem, I just upgrade to beta6,

This is working for me:

  1. Run Xcode 8.0b6 on OS X 10.11.6.

  2. Create a new iOS app from the Single View Application template.

  3. Select the Generic iOS Device destination.

  4. Choose Product > Build, to make sure it builds OK.

  5. Choose Product > Archive to create an archive.

I’m not sure what’s going on with your setup. You may want to try the usual debugging steps:

  • trash

    ~/Library/Developer/Xcode/DerivedData/
  • try on a different account, to see if it follows your user

  • try on a different (possibly virtual) machine, to see if it follows your Mac

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I believe this might be related. I've also run into this recently. For me, reinstalling Xcode solved the problem. I still believe there must be a better way. I got 21 errors in my project when building for a physical device (iPad Mini 3) and all of them were superclass errors in iOS 10 UIKit. Anyways, if you find something, let me know!