drmohundro / SWXMLHash

Simple XML parsing in Swift
MIT License
1.41k stars 205 forks source link

Help with a compilation error #186

Closed estemendoza closed 6 years ago

estemendoza commented 6 years ago

Hi! Thanks for this amazing library

After a year of not updating my app I decided to update all the libraries and pods and when I updated SWXMLHash, I am getting the following error:

screen shot 2018-04-21 at 17 07 58

Any ideas on what this could be?

My target is iOS 10.0 and I already tried to clean up and re-build but getting the same error.

Thanks

estemendoza commented 6 years ago

Forgot to mention that that happens when the library is manually installed. If I installed using cocoa pods, the error dissapears

drmohundro commented 6 years ago

Hi @estemendoza - it sounds like you're still on an older version of Swift. compactMap is the renamed version of flatMap which was deprecated in Swift 4.1. So the latest version of SWXMLHash is now fully functional with Swift 4.1. That being said, if you're still on an older version of Swift for your project, you can continue to use SWXMLHash, but you'll need to target 4.5.0 or earlier. I'm guessing CocoaPods works because it points to a slightly older version of the library.

Hope this helps!

estemendoza commented 6 years ago

@drmohundro Thanks for your suggestion. I decided to move to the pod version, v4.5.1, but now I am getting the following error:

Module SWXMLHash has no module named parse

Any ideas of what this could be? I checked that people had this problem before but that was a long time ago.

drmohundro commented 6 years ago

Well that error means that SWXMLHash isn't actually loaded or accessible... that's with CocoaPods you said? Is that when you open the workspace or the project file?

One other option if you're still interested in manual installation is that you could explicitly use https://github.com/drmohundro/SWXMLHash/releases/tag/4.5.0.

estemendoza commented 6 years ago

Thanks! Copying that version manually did the trick.