IOS setup throwing compiler error

Hello,

I'm attempting to setup a project from scratch and importing the API using Cocoapods. However, after adding the line pod "MetaWear", :subspecs => ['UI', 'AsyncUtils', 'Mocks', 'DFU'] to my podfile and installing the pod, upon the first build after entering Xcode, I'm getting an "Enum element with associated values must have at least one associated value" error.

I've tried restarting Xcode, cleaning and rebuilding the project, reinstalling the libraries, and deleting the DerivedData folder with no luck.
I'm currently running Xcode 10.2.1.

Sorry if I'm overlooking something basic.

Thanks.

Comments

  • Bolts is a dependency, not our code. Might be a compatibility issue with Swift 5:

    https://github.com/BoltsFramework/Bolts-Swift/pull/85

  • Eric is correct, Bolts-Swift hasn't been updated to swift 5 yet and they don't define swift_version in their Podspec. You need to set the swift version for the Bolts-Swift target to 4.0. This can be done manually in the Build Settings or you could drop code into the Podfile to do it automatically.

    Here is one example:

    pre_install do |installer|
      installer.analysis_result.specifications.each do |s|
        s.swift_version = '4.0' unless s.swift_version
      end
    end
    
  • Works like a charm. Thanks.

Sign In or Register to comment.