No Such Module "AirshipKit" when doing import AirshipKit in Swift

I have a project in Swift. I am using 7.3.1 Xcode. I would like to enable my app for use with Urban Airship. 

I created the app in the Urban Airship and followed the instructions quick start TO THE LETTER. Here is what I did

  1. Downloaded 7.3 Urban Airship SDK
  2. Copied over Airship and AirshipKit folder into the Xcode project as instructed.
  3. Copied over the AirShipKit.xcodeproj into Xcode as instructed.
  4. Added AirshipKit.framework to Embedded Libraries
  5. Made Sure that "Enabled Modules (C and Objective C)" and "Link Frameworks Automatically" are set to yes.
  6. Imported "AirshipConfig.plist" into the project as instructed.
  7. Since this is Swift project, I can't add "#import <AirshipKit/AirshipKit.h>" to AppDelegate.m so I added "import AirshipKit" to AppDelegate.swift. This is how it's done in the sample Swift project included with the SDK

Here is where all the problems start. Xcode editor highlights this line and says that "There is no such module ArshipKit"  

What is stranger is that the on one Mac sample project does not display the error and project builds. On the same Mac, my project displays the error at first, but when I build the project the error disappears and project builds. As the matter of fact I was able to send some test messages to iPhone running my project.

On another Mac with the same OS and Xcode versions, both sample project included with 7.3 SDK and my project display the  "There is no such module ArshipKit" at line "import AirshipKit" in AppDelegate.swift and both projects won't build due to this error.

I tried latest 8.3 SDK. This one is even worse. Sample project won't even build due to TON of errors. I enclose screen captures.

Please help. 


 

...

Didn't find what you were looking for?

New post

Comments

47 comments

  • Michael, 

    I got prompted and selected "Create folder references", as the setup guide said to do.

    Comment actions Permalink
    0
  • Rudy,

    What do your header search paths look like under "Build Settings"?

    Comment actions Permalink
    0
  • I used $(SRCROOT)

    Comment actions Permalink
    0
  • Rudy,

    If you could, could you verify that your app has the setup that is described in our Setup Docs. Your header paths appear to be different, so it may not be finding everything. 

    Comment actions Permalink
    0
  • What Airship directory is the setup guide talking about?

    Comment actions Permalink
    0
  • I entered it as ../Airship/**. Still an error

    Comment actions Permalink
    0
  • Rudy,

    Would you be opposed to uploading your project/ a copy of your project to me?

    I have a feeling we're missing something, but it's hard to tell without the full picture of what you have configured already.

    Comment actions Permalink
    0
  • I dont mind sharing the project

    Comment actions Permalink
    0
  • Rudy,

    Perfect!

    I've sent you an invite to upload your files. Once you've done that, I'll take a look and respond here once I have something for you.

    Comment actions Permalink
    0
  • Have you tried Xcode settings? Make sure that you:

    • Start Xcode and open Xcode preferences.
    • Select 'Locations' icon
    • Click on 'Locations' tab
    • Click 'Advanced'
    • Build location should be 'Unique'

    This is how I fixed my problem under XCode 7. I think this applies to Xcode 7 AND 8.

    Comment actions Permalink
    0
  • Nicolas, 

    The build location was already set to 'Unique' 

    Comment actions Permalink
    0
  • I have been looking through the SwiftSample provided with the updated SDK and noticed that some of the settings that I configured don't exist on the project, but that project runs fine with no errors. Is there a reason for that? Im going to try to copy the settings and see if that fixes my issue.

    Comment actions Permalink
    0
  • Rudy,

    Which settings in particular were you looking at?

    Comment actions Permalink
    0
  • Settings like 'Other Linker Flags' and 'Header Search Paths' are left blank. There are also things missing form the 'Build Phases' tab for the app. Same thing goes for 'General'.

    Comment actions Permalink
    0
  • Ive tried both the quick start guide and the more detailed start up guide but still received an error.

    Comment actions Permalink
    0
  • So I built the project to my phone and now there is no error. Hopefully it doesn't return. Thanks for all of the help!

    Comment actions Permalink
    0
  • No problem!

    Comment actions Permalink
    0

Please sign in to leave a comment.