1

I just updated to Xcode 8 and to Alamofire 4.0, and I got some odd errors. The first one is a bunch of errors looking like this:

... warning: Missing file: ... is missing from working copy

This goes on for Download.swift, Manager.swift, Stream.swift, Upload.swift and Error.swift. How to solve that one?

Furthermore I got this one, only for alamofire, not for any other of my libraries:

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

And when I try to convert it, I get

Could not find test host for FieldSenseAppTests: TEST_HOST evaluates to ..."

Cœur
  • 37,241
  • 25
  • 195
  • 267
Recusiwe
  • 1,594
  • 4
  • 31
  • 54

4 Answers4

3

I am able to fix it by setting Use Legacy Swift Language Version to "No" under Build Setting section.

enter image description here

CMA
  • 1,528
  • 1
  • 11
  • 22
1

There's no need to convert anything. Revert the changes you've made (reinstall Alamofire) and do the following:

Select your project (Pods I assume), select Alamofire as a target and go to build settings.

Wnder "Swift Compiler" you can find "Use Legacy Swift Language Version", which you need to set to "No".

dorjeozer
  • 76
  • 6
  • I can't seem to remove Alamofire by just removing it in the Podfile and running Pod install afterwards, nothing happens? I can see I still have pods installed which is not in my Podfile? Maybe because I can't build the project? – Recusiwe Sep 16 '16 at 10:17
  • Close your XCode. Remove it in the Podfile and run pod install. Then add it back to the Podfile and run pod install again. This should do the trick. – dorjeozer Sep 16 '16 at 10:30
  • I still got the same errors from Alamofire that mentioned above. – Recusiwe Sep 16 '16 at 10:39
1
  1. Close Xcode.
  2. Edit your podfile, comment out the line for alamofire.
  3. Save and run 'pod install'. This will remove alamofire.
  4. Edit your podfile, uncomment the line for alamofire. Make sure your alamofire version is 4.0
  5. Save and run 'pod install' to install alamofire.
  6. Open your Xcode workspace
  7. Run migrator, select alamofire target. UNCHECK the suggested changes for alamofire and save.
  8. Try to build.
Hong Wei
  • 1,397
  • 1
  • 11
  • 16
  • I've got something to work, but left with a lot of warnings, how can I get rid of these? I've updated my question with a screenshot. – Recusiwe Sep 16 '16 at 14:18
  • Maybe you can look up the git repos of the offending swift libraries for updated versions for swift 3. Then comment out the swift libraries in the podfile, etc ( the same steps highlighted above). If the library have not been updated to swift 3, find a replacement that is swift 3 compliant or disable the feature which depends on it for now – Hong Wei Sep 16 '16 at 14:26
  • I've done that. Did you see my update? That's after I've updated all my libraries to Swift 3 and removed the others ones. – Recusiwe Sep 16 '16 at 14:36
0

I had the same exact problem and here is how I fixed it:

  1. Copy your Xcode project folder and paste it into another directory.
  2. Open and build the copied project to see if the missing file warnings went away.
  3. If they did, replace your original project with the copied one.

As far as your 'Legacy Swift' issue, see this post.

Community
  • 1
  • 1
tophst
  • 3
  • 3