iOS Build error: ArgumentError - Malformed version number string ["5.1", "5.0"]

To mitigate this, open the project in Xcode, go to Build settings, go to Swift Language Version, change it to 5.1. Then try pod install again