1

I've got to import a Framework into my Swift project that is written in Objective C. So I've created a Bridging file and after I've added the Header files to it and compiled, my project says it cannot find them. The image below shows my Framework and you can clearly see AWController.h but it throws an error in my Bridging file when building.

enter image description here

The Bridging file shows in my Settings so what am I doing wrong or what have I missed? I've set my Defines Module to Yes in Build Settings and my Module Name has no spaces.

enter image description here

user616076
  • 3,907
  • 8
  • 38
  • 64
  • Check out my [answer](http://stackoverflow.com/questions/24062618/swift-to-objective-c-header-not-created-in-xcode-6/30634282?s=1|1.6337#30634282) to this situation Pretty sure this is a duplicate. If it is consider removing, if not update the question. – Tommie C. Aug 04 '16 at 08:08
  • I've made those changes and amended my entry above to show it, it still won't build though – user616076 Aug 04 '16 at 08:20
  • have you installed any pods ? just do one thing create new project and regroup the project again instead of passing time anymore. – vaibhav Aug 04 '16 at 08:25
  • No I'm not using pods – user616076 Aug 04 '16 at 08:37
  • Please copy and paste the error log from the report navigator in Xcode (Cmd-8). When the question is updated I may be able to offer additional insight. – Tommie C. Aug 04 '16 at 15:12

2 Answers2

0

You should not use bridge header. Just use import AWSDK in the swift file where you use it.

zylenv
  • 942
  • 4
  • 13
0

I would review the setup for AWS at their website. They even have a section that details using with Swift iOS9.

Among other things, if you are using the Frameworks manual integration, verify that step 4 is complete.

Under the Build Phases tab in your Target, click the + button on the top left and then select New Run Script Phase. Then setup the build phase as follows. Make sure this phase is below the Embed Frameworks phase.:

Shell /bin/sh

bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCore.framework/strip-frameworks.sh"

Show environment variables in build log: Checked Run script only when installing: Not checked

Input Files: Empty Output Files: Empty

You might want to install and use Carthage to make this easier. Head over to the Homebrew website then after installing homebrew you'd run brew install carthage from the command line. After that go back to the link above and follow the Carthage instructions.

Secondly, I would take another walkthrough of the Apple Documentation on Working with the bridging header files to see if any of the edge cases apply and just as a sanity check.

Third, if that doesn't work, I'd just try creating an empty Swift project and walk through the steps again using one of the techniques above. There might be something wrong with one or more settings in your project files or the file itself might be corrupt.

BTW - The product bundle identifier should probably be following the convention of com.yourdomain.YourProductName.

Tommie C.
  • 12,895
  • 5
  • 82
  • 100
  • 1
    Hi Tommie, this is a great solution and is good to know but I'm using the AirWatch Framework not Amazon Web Services. I'm going to follow this process anyway and will let you know how it goes – user616076 Aug 04 '16 at 11:50