Swift 3 @objc inference and build failed issue

Hello Experts!


I'm at a complete loss. Prior to updating to Xcode 9.4 I was able to build and test my app with no problems, but after the upgrade, when I try to build I almost immediately get a Build Failed message.


When I check the Report Navigator, it just says "Build operation failed without specifying any errors." I noticed that I was getting the Swift 3 @objc inference deprecation error still, so I thought that might be the issue. After reading some posts, I tried changing the Swift 3 @objc Inference to "Default", but all that did was remove the warning message and the build still failed.


Would these inference issues cause the build to fail? And if so, if I have Swift 3 @objc Inference issues within the code in my project, I have no idea how to identify where those issues are. I've never seen before, and I can't see now, any warnings within any of the code in my viewcontrollers that give me the option of selecting "Fix" in order to add @objc.


Any help would be appreciated!

You updated to 9.4 from where ? Form 9.3 ? From 8.x ?


If I remeber well:

You should first set to No

That will show you where you have you have errors because of implicit inference


Correct them


Then turn to default.

Do a clean Build Folder

Close the project

Reopen.

I updated to Xcode version 9.3.1 on May 13 and then to version 9.4 on May 30.


I set the Swift 3 @objc Inference to On because that is the only way I receive the warning.


I then tried to build, which failed again, and I wasn't able to see where the errors are within any of my code. I checked the Issue navigator (Buildtime) and the Report navigator.


Doesn't the project usually have completely build before all the warnings will show up? When I tried to build mine, it immediately fails. Could there be something else that is preventing the project to build?

Try each of these steps in order until the problem goes away:


  • Clean Build Folder (press Option + Product > Clean Build Folder, or press Command+Option+Shift+K)
  • Restart Xcode
  • Reboot your computer
  • Delete Xcode's derived data at ~/Library/Developer/Xcode/DerivedData

>Could there be something else that is preventing the project to build?


I'd follow the cleaning steps as listed first, then if still no joy, try Xcode's menu Product/Analyze - when it's done, select the 'report navigator' (right-most speech bubble icon in the navigator column on the left), then select the appName, and tap to toggle, then choose 'Analyze Today <time>' - there should be a red ⚠ icon for any issue...look thru the list on the right for any lines with red colored text - double tap on them to go to the line in your code (assuming it's your code and not a configuration issue).


See anything?

Swift 3 &#64;objc inference and build failed issue
 
 
Q