iOS Build a Simple iPhone App with Swift Running Apps On a Device Running on Device

Paul Chelaru
Paul Chelaru
4,109 Points

21 errors

When I plug in my device and I run the program I get 21 errors from the category "Swift Compiler Error", but when I use the simulator everything is good and the program runs without problems.

2 Answers

Nathan F.
seal-mask
.a{fill-rule:evenodd;}techdegree
Nathan F.
iOS Development with Swift Techdegree Student 28,947 Points

Hi Paul,

I've never experienced this issue, so I'm firing in the dark here. I did some digging and this seems to be a rather rare problem. In one case, someone had success by reinstalling Xcode--there was an issue with a framework file being blank, but it wasn't obvious because the simulator relies on a different source. Another, it was an issue with certain classes not being marked with @objc in a library they were using.

If your project is on Github, you can send me a link to it and I'd be happy to clone it down and see if I'm able to build to device successfully or not. That'd help us rule out some issues. The alternative would be to try and update / reinstall Xcode and see if that does anything for you.

Paul Chelaru
Paul Chelaru
4,109 Points

I just updated the Xcode and after that, I could run it with no problems. Thank you!

Nathan F.
seal-mask
.a{fill-rule:evenodd;}techdegree
Nathan F.
iOS Development with Swift Techdegree Student 28,947 Points

What sort of errors appear when you run on device? Are they errors or warnings? Some of those warnings might be from not including app icons or other things that would be necessary for a complete, store ready app.

Paul Chelaru
Paul Chelaru
4,109 Points

Attempting to use the forward class 'UIViewController' as superclass of 'UIActivityViewController' / Attempting to use the forward class 'UIViewController' as superclass of 'UIAlertController' / Attempting to use the forward class 'UIViewController' as superclass of 'UICollectionViewController' / Attempting to use the forward class 'UIViewController' as superclass of 'UIDocumentPickerViewController' / Attempting to use the forward class 'UIViewController' as superclass of 'UIDocumentMenuViewController' / Attempting to use the forward class 'UIViewController' as superclass of 'UIDocumentPickerExtensionViewController' / Attempting to use the forward class 'UIViewController' as superclass of 'UICloudSharingController' / Attempting to use the forward class 'UIViewController' as superclass of 'UINavigationController' / Cannot define category for undefined class 'UIViewController' / Cannot define category for undefined class 'UIViewController' / Attempting to use the forward class 'UIViewController' as superclass of 'UIInputViewController' / Unknown type name 'UIModalPresentationStyle' / Cannot define category for undefined class 'UIViewController' / Expected a type