Search code examples
xcodeurbanairship.com

XCode - why do I get a file not found?


I've added the Airship (from UrbanAirship) directory into my xcode project for my iPhone/iPad app. In my "build settings>search paths>header search paths" and "build settings>search paths>library search paths", I'm pointing to those directories recursively. I've also included the libuairship-1.2.1.a file3 into the required frameowrks/libraries.

When I go into my appdelegate.m and appdelegate.h, as soon as I type #import "UA", it autocompletes for me #import "UAirship.h". So i assume this is great ,because i guess it means it knows the file exists!

but when I do a build, it Xcode complains that the file UAirship.h can not be foudn. I tried typing #import "directoryname/UAirship.h", but it still can't find it.

How do i fix this problem?

Screenshot depicting error message


Solution

  • This likely means that the file is part of your project, but its path is incorrect (for whatever reason). This will be visible in that if you locate the file in the project browser its name will be red.

    Assuming that is the case you can select it and edit the files location properties, or delete it from the project and then add that file back again.

    This can happen easily if you import or open projects from other systems.

    Regards