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?
I am sure it is the path under - header search paths.
I just had it set to ../Airship/** and had the same problem you did.
Now that I changed it to ./Airship/** and it works fine.
I also had to import
#import "UAirship.h"
#import "UAPush.h"
#import "UAInbox.h"
#import "UAInboxUI.h"
in the application delegate.
Hope this helps.
For XCode 5.1 I had to set this to ./Airship (recursive)
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
This did the trick for me,
Delete Pod folder and Podfile.lock
then "pod install"
then "pod update”
Or sometimes, pod update and then pod install
Related
I already finished my project, it works and runs perfectly on the simulator or in my own device. When I select to Archive the project to upload de build to Itunes Connect, I get all these compile errors
"Use of undeclared type MBProgressHUD"
"Use of unresolved identifier MPProgressHUD"
And so on..
NOTE: I'm using CocoaPods for this library
What solved it for me was adding import MBProgressHUD in the classes where I use this library, not only in the Bridge-Header.h
Navigate to your project build settings and find the “Swift Compiler – Code Generation” section (You may find it faster to type in “Swift Compiler” into the search box to narrow down the results)
Next to “Objective-C Bridging Header” you will need to add the name/path of your header file. If your file resides in your project’s root folder simply put the name of the header file there. Examples: “ProjectName/ProjectName-Bridging-Header.h” or simply “ProjectName-Bridging-Header.h”.
Refer this link http://www.learnswiftonline.com/getting-started/adding-swift-bridging-header/
Welcome to Cocoapods Hell (a.k.a. : where the magic ends), where one must dive into his project build settings and make sense of what went wrong...
It's very hard to answer to you, as any number of reasons might be causing that.
Do you use the same target for Build / Run & Archive ? It might be because your libPods.a isn't copied into your Archive target
Have you installed Pods using pod install , have you tried playing that command again. (yes, faced with magic going wrong, one can sometimes rely on magic to save him again)
'Build' and 'Archive' product often differ in the build configuration they use (Build most of the time uses 'debug' configuration, while Archive uses 'release' configuration... ). Check your Pods configuration files (debug/release) and make sure they both include your MBProgressHud. Also, in your Project 'Info', check which pods Xcode configuration files are selected for 'debug' and 'release'
Good luck !
(PS : as MBProgressHud is a single file, and one you can often change, another solution is to get rid of Cocoapods and just copy/paste it)
When I create a new project in XCode 6.0.1, I got this error message: The file "exclude" doesn't exist
It seems to only impact the versioning of the files i.e. the generated stub files are not committed into github after the project is created.
What can cause this problem?
For me the issue was caused because I had previously created a project with the same name, and Xcode still had record of that.
To clear it out,
go to Window -> Organizer in the menu bar
Remove all of the repositories highlighted in red
To add your repository (if it's not being tracked for some reason),
Click the + (still in Window -> Organizer from the steps above)
Enter the path of your file
Make sure to change to Git from Subversion (if Xcode has Subversion set as default - it did for me.
I usually get this error if I initialize an Xcode project with a git repository, delete it and try to recreate it with the same name (casing doens't appear to make it sufficiently 'different'). Turns out, "Well I'll just start over" can leave some issues as well.
Hope this helps.
I had this issue as well, and I tracked it down to the .git-template folder included with Thoughtbot's dotfiles. Basically, Xcode expects its template folder to have info/exclude, and Thoughtbot's dotfiles don't. Creating that directory and file fixed the problem, as so (in the Terminal):
cd ~/.git_template
mkdir info
cd info
touch exclude
If you're getting this issue without Thoughtbot's dotfiles, you could probably look at ~/.gitconfig and use whatever templatedir is getting set as instead of ~/.git_template in the first command.
I'm not able to compile a project under Xcode Version 4.6.3 (4H1503) when using files located in /usr/local. The error is 'cryptopp/cryptlib.h' file not found. This is similar to a number of other questions, but the 'try this' mentioned in the other topics have not helped.
I have a directory with headers in them. The directory is /usr/local/ios-armv7/include. Within that directory the headers are located in cryptopp/. I am including the files with both #include <cryptopp/cryptlib.h> and #include "cryptopp/cryptlib.h".
In Xcode, I have /usr/local/ios-armv7/include and /usr/local/ios-armv7/include/cryptopp set in every place that will take a path for headers or include files. There are no target overrides. I verified the paths are being added to the command line through -I switches.
I've tried toggling ALWAYS_SEARCH_USER_PATHS. I've tried toggling recursive. I've also tried adding and removing the trailing slash (/). In between each attempts, I perform a full clean. I also used Organizer to remove all data. I even tried using a different compiler (GCC-4.2, which appears completely broken).
What is the trick to get Xcode to honor my search path?
Wow...What a pain. I just figured it out (was fighting this same issue for some time).
It looks like there are two sets of settings, one for the project, and one for the target.
Look to the left of your build settings pane. If you have the project highlighted, hit the 'targets' icon, and then you'll see there is another set of build settings. As soon as I added '/usr/local/include' to my 'Header Search Paths' section, it found the external headers.
I tracked this problem down to permissions on usr/local/ios-arm7. The permissions were 0600. I'm not sure how/why Finder was able to view them since I did not have permission. After chmod -R 0644 usr/local/ios-arm7, everything worked as expected. I could also remove all the extra paths I threw at the project.
So frustrated with XCode right now. I can build and run from code perfectly fine. However, trying to archive is a disaster.
I created a project, then dragged the .xcodeproj into XCode on the project navigator. Shows up fine, cool. Parent project build settings:
Other linker flags: -all_load, -ObjC
Target Dependencies : CocoaLibSpotify (subproject I'm incorporating)
Link Binary with Libraries : libCocoaLibSpotify.a
When I build my project, the following lines work
#import "CocoaLibSpotify.h"
#import <CocoaLibSpotify.h>
However, when I archive, my project fails to find these files. It's worth noting that the subproject files aren't in the same directory as the parent project. However, isn't that the point of the target dependency/link binary with library? Why is it failing to archive? This seems like it should be a lot easier than it's being.
Thanks.
Edit: Errors from compiling
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/AppDelegate.m:12:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/GUI/ViewControllers/LoginViewControll er.h:9:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/GUI/BaseViewController.h:10:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/Managers/Managers.h:9:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/Managers/AppLogicManager.h:11:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/CoreData/CoreDataObjects.h:13:
/Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/CoreData/Track.h:13:9: fatal error: 'CocoaLibSpotify.h' file not found
#import <CocoaLibSpotify.h>
^
1 error generated.`
Archive uses a different directory structure when building, which can be a pain. I've found success by adding the following to the User Header Search Paths build setting of your application's target:
"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include" (including the quotes).
Also, make sure Always Search User Paths is set to Yes.
In addition, I have $CONFIGURATION_BUILD_DIR/include in my Header Search Paths setting, but I don't think that'll help archiving.
I am trying to learn XCode and I am following an online course. They are telling to use the #import command to point to a header file. I follow the instruction to the letter and I get an error saying"no such file or directory" but the file is listed under classes and the spelling is identical. I wanted to included a screenshot but could not. Please help!
You are getting that error because Xcode cannot find the file you are trying to import.
Correct usage:
#import "RootViewController.h"
or
#import <Foundation/Foundation.h>
You also have to make sure that the file(s) you try to import are in your Project list. If the file you are trying to import is not in this list, then you will always receive this error.
It is possible that the file has been renamed in XCode. When a file's name is changed in the XCode interface, it's actual name is no longer changed in the file system. It used to, but doesn't anymore. In order for the compiler to find the file, you have to use the path to the header in the file system. Make sure the files are in the same folder and use the name displayed by Finder.