1

I'm new to iOS and am working on an app in Swift. I'd like to use CocoaPods for dependency management, but I am having issues. I've been able to install CocoaPods on my Mac, run pod init to create my pod file, and run pod install to install dependencies just fine. The .xcworkspace file was installed and I've been using it with my project.

My problem comes where after I add any pods to my pod file and run pod install, then go to build my app, there are errors with the pod files that get installed and the project wont build. I've tried a lot of different pods and all have similar errors. My guess is that the errors are related to the Swift version, but I'm not familiar enough with the tools to know how to adjust it.

The project will build fine if I remove the pods from the podfile and run a pod install again.

The errors are all over the files and are things like:

Expected declaration
Consecutive declarations on a line must be separated by ';'
Expected '{' after operator name in operator declaration

My environment specs

  • pod --version = 1.1.1

  • XCode Version = 8.2 beta (although I'm seeing the same issues on 8.1)

My podfile:

# Uncomment the next line to define a global platform for your project
 platform :ios, '9.0'

target 'MySampleApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MySampleApp
  pod 'Marshal', '~> 1.0'
  pod 'FontAwesomeKit', '~> 2.2'

end

Also, the app I'm using is the starter sample app from AWS Mobile Hub. Everything works fine until I add a pod.

Any help would be much appreciated. I just don't know where to go from here.

robmon
  • 49
  • 5
  • Have you tried to build a other project install those pods? I think is somewhere you go wrong. Then find which step is wrong. – aircraft Dec 04 '16 at 01:01
  • I can build a brand new blank project just fine using these pods. I'm sure there is some setting somewhere with either cocoapods or my project that is messing things up... I'm hoping someone might have some more insight about this. – robmon Dec 04 '16 at 03:58

1 Answers1

0

I've found my problem. The Marshal library I was trying to use was not Swift 2.3 compatible (it was build for Swift 3). The AWS Mobile Hub sample app was using Swift 2.3, so I couldn't compile the two together. I decided to use a different library to parse JSON (pod 'SwiftyJSON', '2.4.0') and my app is building fine.

robmon
  • 49
  • 5
  • I didn't get Mobile Hub working with Swift 3. I am using Swift 2.3 with my project. I had to use Swift 2.3 compatible versions of the libraries I'm using. – robmon Jan 19 '17 at 22:40