0

I am attempting to use the MetaWear cocoapod to connect to BLE sensors from my IOS application. Before adding this pod, I created a basic Single View Application in Xcode. I tried to compile and run it on my iPhone, and it showed up as expected.

Having done this, I did a pod init, and updated my Podfile to look as follows, as recommended in the above MetaWear cocoapod link:

platform :ios, '12.2'

target 'myProj' do
     use_frameworks!
     pod 'MetaWear', '~> 3.2'
end

Once I run "pod install", I get the following output:

Analyzing dependencies
Downloading dependencies
Using Bolts-Swift (1.4.0)
Using MetaWear (3.2.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.

I then open my Xcode project ( myApp.xcworkspace ), and when I try to re-build the project, I keep getting this error:

 Could not build Objective-C module 'BoltsSwift'

This is also shown in the following image:

enter image description here

As a result, I was under the impression that maybe I should downgrade the BoltsSwift version, but specifying something lower than 1.4, seems to be ignored. For example, I added this pod:

pod 'Bolts-Swift', '~> 1.3'

And my output after running pod install, still yielded "Using Bolts-Swift (1.4.0)". So I am not too sure how to get rid of this compilation failure. Maybe downgrading BoltsSwift is not the correct course of action. What can I try? (I am using Xcode Version 10.2.1 (10E1001))

Cœur
  • 37,241
  • 25
  • 195
  • 267
angryip
  • 2,140
  • 5
  • 33
  • 67

1 Answers1

0

Ok, turns out that by default, XCode set my Swift compilation to 5.0 for the BoltsSwift and MetaWear pod. I changed it to Swift 4, and I was able to build.

enter image description here

Updating the pods compilation level might also be a good idea, as described here :

How to set the Legacy Swift Version for each Pod in Podfile Xcode 9.0 Swift 3.2 / Swift 4.0

angryip
  • 2,140
  • 5
  • 33
  • 67