count_blah count_blah - 2 months ago 18
Swift Question

Unable to build ScanApiSdk with error ScanApiHelper.h file not found

I am attempting to add in the Socket Mobile ScanApiSdk into my project but it is failing to build with the error 'ScanApiHelper.h' file not found. I have installed it into my project workspace using the CocoaPods method. Unzipped the SDK into a folder at the same folder level as my project folder. Adding the following line to my Podfile.

pod 'ScanAPI', :path => '../scanapisdk'


Then ran the pod install command at prompt. Launched project from the xcworkspace file and then added the following line to my bridging header.

#import "ScanApiHelper.h"


Build fails at this line in the bridging header.

Xcode Version 8.0 (8A218a)

gem --version 2.0.14.1

pod --version 1.0.1

ScanAPI SDK Version 10.3.55

I was able to download the sample SingleEntrySwift project from Github, build it, and load it on my iPhone for testing.

Can someone help point out what I am doing wrong in my own project or troubleshooting steps?

Answer

I had this issue too and this solution worked for me.

Basically, you don't need a bridging header if you use use_frameworks!. Instead you just import ScanAPI in any swift files that use ScanAPI.