2

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?

Kumar_Vikas
  • 837
  • 7
  • 16
count_blah
  • 23
  • 3
  • Are all the files from the SDK zip, e.g. `ScanAPI.podspec` and `ScanApiHelper.h`, inside `scanapisdk` or are they in a folder nested inside it? Can you try using the absolute path to your ScanAPI directory? – Enrico Oct 03 '16 at 20:51
  • All files are in the base scanapisdk folder, there is no sub-folder. I just tried using the absolute path to the scanapisdk but it still failed to build. The pod is being installed successfully. I can see it under the Pods tree in my project navigator, under Development Pods and then ScanAPI. There I see the ScanApiHelper.h – count_blah Oct 03 '16 at 21:24
  • Can you make sure that the path to your bridging header file is set under `XCode -> Build Settings`? – Enrico Oct 03 '16 at 23:17
  • The bridging header file was not in the build settings, but I have other libraries in the bridging header that are compiling properly. I went ahead and added it however the issue is still not resolved. I did notice some settings in the Pods-{appname}.release.xconfig file from the sample github project which are not in my project. – count_blah Oct 04 '16 at 14:39
  • Disregard the comment about settings found in xconfig I found them in the ScanAPI.xconfig under Support Files for the ScanAPI development pod – count_blah Oct 04 '16 at 15:29
  • Hmm... this is quite strange. Can you compare [this project](http://www.filedropper.com/testsdktodelete) to your project? It was created from scratch using XCode 8. In `BridgingHeader.h` it says `#include ScanApiHelper.h`, but `#import` worked too – Enrico Oct 04 '16 at 16:02
  • Your testSdkToDelete compiled just fine after I pointed the pod file to my copy of the SDK and ran pod install. I also created my own project from scratch and was able to get it to build. So it is just my actual development project I cannot get it added to. All I can think to do is rebuild my application from a new project but I would really prefer to avoid that. – count_blah Oct 04 '16 at 19:55
  • This is getting pretty infuriating. I can get it to build in anything but my own project with the only difference being my project was created in Xcode 7.3 – count_blah Oct 05 '16 at 16:50
  • That's understandable. Can you email developers@socketmobile.com and include some more details about your setup and when it started to fail? For instance, did you only upgrade xcode or did you migrate from swift 2 to swift 3 at the same time? Which other pods do you have installed? – Enrico Oct 05 '16 at 17:06

1 Answers1

1

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.

Community
  • 1
  • 1
C. Carter
  • 291
  • 2
  • 11
  • 1
    Yes this was the exact solution. Discovered it just a little bit ago when troubleshooting with a developer from socket mobile. Thank you for posting! – count_blah Oct 07 '16 at 18:26