I updated Xcode to version 10 recently and started to receive a strange error when trying to build my project. I'm currently on Swift 4.0 and I did try to upgrade to swift Version 4.2. But when I did I received this same error in many of my frameworks.
Command Compile Swift failed with a nonzero exit code
So far I've deleted the derived folder. Updated all pods, also deleted all pods and reinstalled them using the terminal commands below.
sudo gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod clean
pod install
This didn't work to fix my issue. However, I found something that could work which was adding arm64
architecture in Build Setting -> valid architectures
and enabling automatic code But, when I checked it was already there and code signing was enabled already.
Additionally, I do have a few other build errors that have to do with frameworks.
SwiftMessages
Value of type 'SwiftMessages.Config' has no member 'presentationContext'
WhatsNewKit
Missing argument for parameter 'backgroundColor' in call`
I opened issues with the developers of each of these frameworks to seek help with these issues.
Issue On SwiftMessage GitHub Issue On WhatsNewKit GitHub
When I click presentationContext
it brings me to the struct within the SwiftMessages
Framework. Usually, when I've had the "has no member" warning I cannot click to see the original place where it exists.
I assume this has something to do with cocoa pods, but haven't been able to find a solution yet. What can I do to correct this issue? If anyone could help would be deeply appreciated been stuck on this for a day now.
Update: The two frameworks latest builds were for swift 4.2. When I changed the version of each framework to one that was built in swift 4.0 I got the project to build.
Make sure that, Your project build settings Optimization Level is in No Optimization[-Onone].
Good Morning! Do a clean. using"commond + shift + k Close Xcode. Navigate to project directory where the Podfile exist. Do pod update/pod install Open x.xcworkspace
for pod SwiftMessages if your app is not swift 4.2 you need to user the version 5.01 pod 'SwiftMessages', '~> 5.0.1'
and it will work like a charm
I had several frameworks (homegrown) plus my app. Somehow they ended up being out of sync as far as the Swift version. Make sure that all frameworks are the same version. In my case, they all needed to be set to Swift 4.2. If you haven't done the migration to 4.2 then remember that Xcode helps with this: Edit -> Convert -> To Current Swift Syntax.
I just had the same error message and none of the answers here and in the duplicates of this question were applicable to my project or helpful. I kept on reading through the error messages and came to a realisation that I had stupidly named two seperate swift files in different folders with the same name intending to change one, but before I got to change one, I tried to run my project and have been annoyed for the last hour.
Bottom line, don't accidentally name your files the same name and read your error codes thoroughly!
Make sure that, your project Swift Language Version is in the proper version. SwiftMessages 6.0.0 works with Swift 4.2.