7

I recently upgraded my Swift iOS application from Xcode7 to Xcode8 and deployment platform from iOS 9.3 to iOS 10. My application started breaking with errors like this:

Module file was created by an older version of the compiler: rebuild 'SwiftyJSON' and try again.

I Googled around and found this link on SO Module file was created by an older version of the compiler. Followed the instructions and removed the derived data and rebuilt using carthage update --no-use-binaries command. But the application still fails to build and complains about the error message mentioned above.

Is SwiftyJSON supported by Xcode 8 and iOS 10?

Community
  • 1
  • 1
Nital
  • 5,784
  • 26
  • 103
  • 195
  • Have you looked on [github](https://github.com/SwiftyJSON/SwiftyJSON)? If there is any support there is a note. – vadian Sep 12 '16 at 16:06
  • Yes, i looked into this https://github.com/SwiftyJSON/SwiftyJSON#requirements and I do not see any mention of Xcode 8 and iOS 10 – Nital Sep 12 '16 at 16:08
  • Right after the summary there is *For Swift3 support, take a look at the [swift3 beta branch](https://github.com/SwiftyJSON/SwiftyJSON/tree/swift3)* – vadian Sep 12 '16 at 16:13
  • Ok, but my application is still using Swift 2 and how would I add this new dependency through carthage ? – Nital Sep 12 '16 at 16:21

5 Answers5

6

SwiftyJSON now supports Swift 3.

pod 'SwiftyJSON', '3.0.0'

Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
5

At the time of writing this: no.

But there is a fork of the swift3-branch which is working with the GM seeds.

https://github.com/acegreen/SwiftyJSON

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
  • Yes, I see it there but not sure how to integrate it with carthage or cocoapod. Can you please guide ? – Nital Sep 13 '16 at 18:52
  • @user2325154 In Cocoapods, you can import it like this: `pod "SwiftyJSON", :git => "https://github.com/acegreen/SwiftyJSON.git", :branch => "swift3"` – FelixSFD Sep 13 '16 at 18:57
  • Hello i installed the swift 3 branch but i still have the "Module file was created by an older version of the compiler..." do i have to delete the old dependency first? I use cocoapods. I tried pod update and pod install both later on give me the same error on xcode 8. – Kegham K. Sep 18 '16 at 12:46
0

pod 'SwiftyJSON', git: 'https://github.com/BaiduHiDeviOS/SwiftyJSON.git', branch: 'swift3'

You will get a lot off error after that please delete your derived data folder. And build it. All works fine

0

pod 'SwiftyJSON', git: 'https://github.com/BaiduHiDeviOS/SwiftyJSON.git', branch: 'swift3'

0

I fixed this by removing the named file, e.g. /Users/me/Library/Developer/Xcode/DerivedData/ProjectName-aprzyqkcjkpzgaedatcseafvznfq/Build/Products/Debug-iphonesimulator/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule

Not positive I'm on the right path, because the file was NOT regenerated, but I appear to be past the problem for now, and on to ordinary Swift3 conversion errors in my own code.

Jack Orenstein
  • 169
  • 2
  • 9