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
- Downloaded 7.3 Urban Airship SDK
- Copied over Airship and AirshipKit folder into the Xcode project as instructed.
- Copied over the AirShipKit.xcodeproj into Xcode as instructed.
- Added AirshipKit.framework to Embedded Libraries
- Made Sure that "Enabled Modules (C and Objective C)" and "Link Frameworks Automatically" are set to yes.
- Imported "AirshipConfig.plist" into the project as instructed.
- 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.
It looks like you're building an app for iOS 10, is that correct?
If you are planning on supporting iOS 10, please try updating to the latest library version (8.0.0) as that will have support for iOS 10.
Once you have done that, clean and rebuild both AirshipKit and your project, and let's see what Xcode says after that.
I am building against 9.3 iPhone. The Xcode project is set to compile against 9.3 device. Xcode is 7.3.1 and MacOSX is 10.11.6.
I tried 7.3 and 8 Urban Airship SDK.
I can send you a my project so you can take a look at it.
I can't even get SDK 8 to compile the sample project against ANY target. The third image I uploaded is what I get when I try to compile it.
Are you on the latest version of Xcode as well?
If you are, let me know. I'll send over an invite to upload your sample project so we can take a look at it.
Please let me know how can I send you the sample project.
Just sent you an invite to upload your files. Go ahead and upload there and I'll take a look.
I uploaded a simple test app that simply tries to include Urban airship SDK and do nothing else.
I was able to build the project successfully on my end.
I did note that I had to do the following:
1) Convert the project to use Swift 3
2) Make sure the code signing is specified on both the project and the Airshipkit project
3) Build Airshipkit first, then build the entire project.
I've uploaded my version of your project, could you give that a shot?
For reference, I am currently on Xcode 8 and using Swift 3.
No change. I can build the project you send me on my desktop Mac, but on my laptop Mac, 'No Such Module AirshipKit' error persists.
Why two different behaviors on two different Macs? I checked, both Macs have the same OS and same Xcode.
It could be a caching issue on the laptop itself.
I'm sure you've already cleaned and rebuilt the project (and if you haven't, go ahead and do that), but what you might do is exit Xcode completely, then delete the ~/Library/Developer/Xcode/DerivedData/ModuleCache folder. You may consider deleting that entire DerivedData folder if you wish.
I just did as you suggested. I cleared the cache folder and cleaned the project. No change.
I tried creating Objective C test project on my laptop. Objective C project builds on my desktop and fails on my laptop just like the Swift project.
I even tried to clean project and emptying the cache again. Still no good for both Swift and ObjC test projects.
This is seriously strange... Am I the only person who had this problem?
Do you know if this same build error happens if you build either of the Sample apps included with the library?
I can build ObjC and Swift samples that come with SDK 7 on my desktop.
I can't build them on my laptop. I get the error that AishipKit can't be imported into AppDelegate, no such file.
The only major difference between my laptop and desktop is that laptop is 2010 vintage and desktop is 2015. They have same version of OS and Xcode. I don't use any software that hooks into OS that might cause problems. My Macs are as plain vanilla as possible.
I have the same problem
Hmm...That's very very odd.
Alright, desperate times call for desperate measures.
Let's go ahead and completely uninstall/remove Xcode from your laptop, and redownload the latest version and install Xcode Tools. It'll take awhile, but we'll give it a shot and see if that does it.
We got new Mac Mini. I tried building on this Mac. No problems, so we have more than one Mac on which we can build..
I need to get our app into app store asap, so I will work on this this week.
I will go back to diagnosing this problem later.
Let me know when you're ready to tackle it again. I'll be here :)
Have you tried the any of the steps I laid out previously, and did any of those work to resolve the issue?
I tried clearing the cache and cleaning the project. Re-installing Xcode takes a long time.
I will try this tomorrow, I am almost done making our App Airship compliant.
In case you are interested, I installed Xcode not from app store, but from DMG file downloaded from Apple on both Macs.
That should be fine as long as it was downloaded from https://developer.apple.com/download/ (Which, I'm assuming it is)
That's where I got Xcode from. I would never download any software that was not from an 'official' source.
I am now researching how to 'reset' Xcode. I will try this tomorrow when I bring the bad laptop to work.
I found the solution to the problem.
Good to hear! Glad you got it to work :)
Hm. I thought I'd just try to get the SwiftSample app up and running - but same deal on that. Generates a whole mess of errors. From your list of suggestions above, which is the one you'd recommend?
As a first step, you'll want to make sure code signing is turned on for the AirshipAppExtensions project. Then, you should be able to build the AirshipAppExtensions from there and that should resolve some of the errors, at least.
I am having the same issue as Nicolas. I have followed the setup guide word for word and still get the error "No such module 'AirshipKit'". I was somehow able to fix this error on a previous project that I did but now I can't seem to solve the problem. The previous project is running on the last update for version 7 of the SDK and everything worked fine. I am currently using XCode 8 and have the target set for ios10.
Have you already tried to build the AirshipKit project before building the entire project altogether?
I was able to build AirshipKit by itself with no errors.
So, AirshipKit is building at least.
Could you post a screenshot of how you have everything laid out in your project, similar to what Nicolas posted?
Or, are you simply building with the Sample app?
When you added AirshipKit to your project, did Xcode prompt you to create Folder References at all?
If so, we want to choose "Create groups for any added folders". I know that has messed up some builds before in the past.