xcode build configurations search paths - iphone

my iphone app builds fine in debug configuration, but when i change it to release, i get hundreds of errors, starting with "CoreServices/CoreServices.h: No such file or directory" in AudioFileComponent.h - part of the AudioToolbox framework.
i can't find where in the project/build settings is responsible for this.. thanks for any help.

I would recommend the following:
Open up your debug target's build settings by right-clicking on the target, hitting "Get Info", and selecting the Build tab.
Select All (Command-A) so the entire contents of the Build setting panel is selected, then copy it to the clipboard.
Paste the contents of the clipboard to an empty text document
Repeat steps 1-3 for the release target of the same project
From there you can use a diff utility or some other method to compare the contents of the two files, which will show you the settings that differ between the two configurations. Some of them will make sense (e.g., optimization settings) whereas others will not. Most likely there is a setting that differs between the two that will resolve your problem.
Another thing you can do is build one of your source files in debug mode, and in the Build Results window copy the contents of the command line to a text editor. Repeat for release mode. Then, replace each space in the command line with a newline (\r). From there you should be able to do a rough side-by-side evaluation of the differences between the two compile instructions, and may be able to figure out what's missing from that.
In general this helps you get a better feel for exactly what XCode is doing under the hood to build your project, which is a good strategy to practice no matter what tool you are using for development.

i think the problem was because i had the audiotoolbox package in the wrong place, it wasnt in system/library/frameworks like it should have been. (this doesnt explain why it built ok in debug though)

Related

Xcode 4 - renamed/deleted file, yet get 'file not found' error

I just used Xcode's refactoring tool to rename a core data class from Player to Person. After fixing about 100 errors resulting from using dot notation that Xcode missed in the rename, I got to the last one:
Player.m - Lexical or Preprocessor issue - 'Person.h' not found
Player.m no longer exists in the project, and shows up as deleted (empty icon) in the error. Obviously, since I got rid of it, I don't want it to exist anymore!
To fix this, I have tried re-adding an old copy of Player.h and Player.m, and also cleaning. I have checked the Build Phases->Compile Sources section, and Person.m is there, Player.m is not. Person.h does in fact exist.
Not sure if it matters, but I am using mogenerator to generate my core data classes. Also, this is my third xcdatamodel version. Versions 1 and 2 used Player.h.
Here is a screenshot of the error:
Try clean build, if that doesn't work, restart Xcode, if that doesn't, delete the DerivedData directory, maybe even reboot.
Xcode sometimes gets confused.
You can try to do a super clean (not sure what the real term is) by hitting Cmd+Alt+Shift+K. This performs a clean and removes everything from the build folder.
Well I had a very similar problem and solve it removing the missing compile source of my project settings. to do that follow these steps
Click at the project page. This page contains the general settings
of your app
Select Build phases.
In Build Phases section, select compile sources.
If there is missing some class or file or something that needs to be compiled.
Select water mark file and click the minus sign at the bottom of this section.
Just click and the project may run. I hope this help others.

Packing an Actionscript (Flash Builder) application for iPhone

Recently I tried to build a flash application in Flash Builder, and I wanted to export it to my iPhone. I have gone through all the required steps in order to certify my application.
Now, with all that done, all that was left to be done is building the ".ipa" file in Flash Builder. Now, this gives the following error:
'Launching TestGame' has encountered a problem.
Error occurred while packaging the application:
NotBefore: Wed Apr 11 18:52:40 CEST 2012
Google didn't give me a decent answer, nor does Adobe's information regarding mobile application development. All I can think off, is that I can't build the application before that date. That's ridiculous, I can't imagine a certain check like that.
I'm pretty sure my ".p12" key file is generated correctly.
Is anyone else familiar with this error? Please, be so kind to guide me in the right direction.
Kind regards,
Matthias.
The error occurs because the compiler didn't find the files under the corresponding directory such as debug-bin or release-bin folder. (explains from: http://forums.adobe.com/thread/893772)
For example, if you are doing a debug-build, and you didn't select the project option: copy non-embeded files to the output folder. And debug-build needs some files such as icons files under the debug-bin folder, and it couldn't find it.
Solution: select project compiling option: the copy non-embeded file to the output folder.
Try again, if still not you will need to try the ADT build to get more details http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac35eb7b4e12cddc5fbbb-8000.html
I suggest compiling from command line. I'd ported an AIR app to iOS and compiled using adt dirrectly (without FB or whatever), and there were more meanful messages then yours. Take a look at the manual on how to build ipa wit adt. The other advise is to check your iPhone node in app.xml (take a look here) and icons.
The "error" was thrown because the certificate wasn't valid yet. It became valid on the date shown above.
You could also fix the manifest file in the iOS developers center.
This problem does come up more often than needed. The error reporting is lacking distinctions but is also difficult to asses since there can be many factors causing this error. If it was one factor or even just a few then it would most likely let you know.
A great way to ensure that the error reporting can do its job and tell you where the problem is is to check your error log. It will tell you at least a few of the places that threw the block.
If you are unable to read those strange glyphs then just ensure that all your resources are being packaged. This does mean a little time of list checking but it is well worth it, for the errors and to get rid of development junk.
The first step in the asset list check is to go through each part of your Assets class (flash builder reference). If you do not have a direct Assets class then you may want to make one and move all of your asset calls to that one class - since it will save you time if this happens again.
Your Assets class is not the same as your Assets folder. Your folder is where the files are stored - i.e. images, bitmaps, sounds, etc. Your Assets class is what categorizes and assigns references to each individual file.
Go through your Assets class to ensure that each of those files exist in the folder as well. Then go to the Project menu (top near Navigate and Search) and select Clean. Either clean all your projects or check the current one. Once this is done you need to click on your Assets Folder (right click or highlight and hit edit or whatever), and select Refresh. This will check that all the files are still there and get rid of/update them.
If none of this throws an error -red X- or other errors then you need to check your project .xml file. This may take you some time to ensure that all of your add on packages and details are correct. Make sure you have the correct:
at the top and it matches your current air release.
Make sure all the filenames, names, ids, version numbers, aspect ratios, fullscreen, visible, icons, extensionIDs, and everything else are not only correct but actually there. Most of these statements should have something written and not be blank. If they are blank find out what to put in.
Ensure that you have the proper icon file extension. If it says assets/icon48.png and the icon48.png is actually in assets/pictures/images/icons/toomanyfilesextensions/whatever/icon48.png
you need to fix that link.
The last thing that you will need to check is when you want to either Release Build or Debug. You need to make sure that all assets are checked and selected.
Go to Project - Properties.
then select ActionScript Build Path.
Click the Native Extensions tab and see if there are any red X's. If there are tap the little arrow beside them and see what the matter it. Add the correct ANE or get rid of it or whatever you need to do.
Then in the same menu go to the left and select ActionScript Build Packaging. A little arrow should be beside that one too. Tap the arrow and it will open to Apple iOS, BlackBerry, Gooogle and whatever else you have (probably nothing more). Select the OS your want to use, lets say Apple, and you will have 4 tabs pop up. Make sure you have the correct certificates selected. If you have none or are confused about this you need to spend some time on Google.
The biggest one for this error is under the Package Contents tab. Most people miss this!
Open the tab and see if anything is not checked. There will 99.99% be something or many of them not checked if you are getting this error. Just check them all and you can figure out what you need and don't need later. Some of them will be listed because you just threw in a bunch of ANEs and .SWFs to have some awesome app. Those add on packages will throw in unnecessary contents into this package. That is fine and don't worry until you want to be picky. Just make sure they are all selected and hit Apply and Ok.
That's it. You should have a working Release Build if you did everything else correct and this error should be easy from now on (but time wasting).
You may get a 'slip' error now, but that is another story. But that is a great sign because you are getting closer to that stupid mistake that we all make: the elusive spelling mistake.

How to modify Xcode 4 Project to be Machine independent like Visual Studio or Eclipse behave

I'm very surprised not to be able to open my Xcode project on another mac, I have never that kind of problem with Visual Studio or Eclipse. I have tried this Info.plist file "no such file" error but it's not enough.
I have other errors like MyAppViewController files not found in some folder whereas I checked that the files are actually there.
So how do I modify XCode 4 project so that it can be opened on any mac ?
Update: contrary to what is claimed here Duplicating / importing Xcode projects from one Mac to another copying isn't enough
Update 2: should I be obliged to buy that kind of tools to do so ? http://itunes.apple.com/fr/app/project-duplicator-for-xcode/id467950482?mt=12
Copying the files over is enough, as long as you copy all files over and no files are referenced from your project file using absolute paths.
Note that you don't have to choose to have absolute paths. I'm unsure of the exact details, but I've ended up with absolute paths in projects without doing so explicitly.
For example, here's a project with a missing file:
When I select the missing file, I can see that it's using an absolute path:
At this point, you have two options:
You can click the button in the bottom right of that red box I've drawn to find the file. Make sure you pick the right file; if you pick one with a different name, Xcode will happily replace DetailViewController.m with SomeUnrelatedFile.m and you'll have lost the hint about the original file. After finding it, make sure to pick Location: Relative To Group (usually, that'll be the right choice anyway) to avoid this happening again.
Possibly safer, go back to the original computer. For any file that you know is missing on the destination computer, pick Location: Relative To Group. Then copy everything over again.
I'm not sure if this is what you're after but it might help; I use git on to keep my two laptops in sync with a single project. I don't have any file missing errors and it comes with all those other repository benefits.
You shouldn't need any tools to do this, Xcode projects can be moved, shared between other members of your team and opened on any supported machine.
There must be another problem you have, so you need to post the error.
And when you get it resolved.... using a free remote source control service such as bitbucket, would be good for you to know and get into the practice of using.

TFS 2008, remove file from source control but leave it in the project

We are using Scott Hansleman's suggestion for multiple web.configs from his post here. The problem we have is that we have to check out the Web.Config. If we remove it from the project, when we publish, no web.config is pushed. So we need to remove the source control bindings just from the web.config, but leave it in the project, and have the rest of the project still held under source control.
The issue is that source control makes the file read only until you check it out. We need to be able ot overwrite it with the prebuild events, preferably without having to check it out. Is there a way to remove the bindings from that file only, and still leave it as part of the project?
Thanks.
By adding a new file to solution explorer, you will get the little plus sign indicating it is due to be added to source control. Then, right-click and choose "undo pending changes". This will cancel the add but leave the file in your project.
If that doesn't work I suggest one of the following methods:
Use the Attrib task from the MSBuild
Community Tasks project to remove
the read only flag.
Use the Exec
task in MSBuild to invoke
tf.exe and checkout the file.
You should leave the file in source control. Otherwise you'll run into several issues:
changes won't be versioned. 'nuf said.
it can't be branched or merged, even though web.config is one of the files that's most likely to vary between parallel dev/test/production environments
changes you make locally won't propagate to coworkers without manual workarounds
developers setting up an environment for the first time won't get the file at all
Team Builds won't contain the file, so neither will your deployments. (surely you're not deploying directly from the desktop?!)
Note that the state of individual files is stored entirely on the TFS server. ('tf properties' dumps this metadata if you're curious) Only projects & solutions have bindings actually written into the file. And even those are dummy entries that tell VS "don't worry about me, just ask TFSProvider, it'll know who I am and where I'm supposed to be." While there are many other quirks in the VS project system that give me endless headaches, in this case it's your friend. Don't circumvent it.
Best options:
Edit your build script to toggle the read-only attribute before/after modification. If you're using the "copyifnewer.bat" script from the linked blog post, it should literally be one extra line. Even if you want to keep things entirely declarative within the MSBuild makefile, it's barely any work with the help of 3rd party tasks.
Use the File -> Source Control -> Exclude feature. After applying this setting, the file remains under source control, but will no longer be subject to automatic checkouts/checkins by the active solution. In other words, you can edit the file locally to your heart's content without affecting anyone else, but if you want to commit (or shelve) your changes you'll need to do it from Source Control Explorer or the command line.
Option #1 has the advantage of being a very quick fix for your existing setup. The downside comes from maintaining several copies of web.config.* Same reason why copy/pasting code is bad: if you change one, you have to go change all the others -- or worse, forget and let them drift out of sync until strange bugs force you to revisit the issue. This could be improved by changing the process so that there's only 1 "master" web.config and the additional copies only contain differences (via a textual diff engine, XSLT transforms, programmatic manipulation in Powershell, etc). Of course, that's more work.
Option #2 avoids #1's problems with very little overhead. (the engineering process itself is unchanged; only difference is how the Visual Studio UI behaves) This advantage is critical if you make changes to web.config at all frequently. Downside is that there is no built-in way to track variations on the "master" file. If the only diffs are dirt simple, eg a connection string or two, you may find it easiest to stick with just one "master" and let people make ad hoc changes on their dev machines. There are even tools to do this for you, such as Web Deployment Projects (easy) and the IIS Deployment Tool (complex). In any case your actual deployment should be automated and source-controlled, of course! If heavier customizations are required than these tools are capable of, then you'll probably want the hybrid master + transform approach described earlier.
I recently ran into the issue and could not find a good solution. With a little trial and error I was able to figure this out myself.
This works on Visual Studio 2015. I tried to follow the answer above, but 2015 does not have an "Exclude From Source Control Option" I could find. It does have source control / project integration where if you delete the file from source control or the project, it will automatically be removed from both places. This integration is enforced when you have the solution containing the project open.
The problem is when using a web.template.config, web.config is really a build output and should not be in source control. However deleting the file entirely and removing it from the project causes problems because then the file is not part of the Build / Publish steps.
So the work around turns out to be simple:
Close the solution. File --> Close Solution.
In the Source Control Explorer Window, Delete the file.
Check in the Change.
Open your solution and you will see that the Config file remains in the project.
You may see the Triangle / Exclamation Mark Icon warning showing the the config file is not found.
Rebuild the project and click on the file.
The file should now show without the warning.
It should not have the padlock icon next to it. This indicates that it is not under version control.
I did some more checking and found the "Exclude From source Control" feature. The key is that you need to select the item in the Solution Explorer window before selecting the menu item:
Select the Web.config file in the "Solution Explorer".
In the menus select File -> source control -> advanced -> Exclude Web.config from Source Control.
You will now get a Red Circle / White Line icon.
This works if the file is NOT ALREADY in source control.
If the file IS ALREADY in source control you need to do the procedure above to remove it from source control without also deleting it from the project.

Editing a run script build phase in XCode

In XCode I made a new run script build phase and want to do one of two things:
Edit it
Delete it
I can see how to add a new one, but not how to access the existing one?
In xcode project tree, click on targets, then pick the target for which you added script. Each time you add new script/event it will show up as a new grey folder in target's subtree. Pick folder named 'Run Script', right click, select 'Get info': script body will be in 'General' tab.
If you have multiple scripts, you probably would want to rename them in that target tree.
I realize this is really old (And the solution I'm mentioning might not have even existed when it was asked), but I came across it when looking into how to do the same thing, and thought it would be useful to put in my findings for anyone else. I've discovered that if you check the box for Run script only when installing on the run script screen, then it will only run when you do an Archive. I guess since there isn't an "Install" option for iOS apps, Archive gets treated as the same thing, at least for this purpose.
For people who have been searching for how to add a run script build phase, there is a simple step-by-step guide (with screenshots) at http://runscriptbuildphase.com. It shows both Xcode 4 and Xcode 3.
Found it!
In the XCode Build System Guide look at Adding and Deleting Build Phases.
In your XCode project, under Targets in the Groups and Files pane you can see the Run Script... double click to edit, delete to delete.
// :)