Strange behavior of Xcode Build Products Path under Build Locations - iphone

I've been looking for an answer but I couldn't find so I'm posting the question here.
Every Project I created under Xcode4 gets the exactly the same "Build Products Path" under the project or target settings - Build Locations
I wonder if this is because I did something back in Xcode 3 and somehow permanently set the value ?
I have uninstall completely and re-install from scratch and still the same thing.
I just created 3 brand new ios projects (windows based) under the xcode4 and those all have the exactly same value for Build Products Path... in my case, it's always pointing to
/Users/RebeccaKennedy/Documents/Projects/iPhone/tmp
every time! every project... this is getting really annoying...

Close all your projects in Xcode, but leave Xcode open
Open up ~/Library/Preferences/com.apple.dt.Xcode.plist
Find the key: IDEApplicationwideBuildSettings
Delete the two items in that key
Save, restart Xcode
be careful w/ step two. the .dt. is for Xcode 4. without the dt is for Xcode 3.
This is almost certainly the result of Xcode migrating old preferences to 4 from 3.

You haven't said what you've tried...but check this setting in Xcode Preferences.
I assume you've check these two locations (search for tmp)?

Related

XCode 7 auto-completion doesn't work properly

It seems XCode 7 (beta) doesn't get auto-completion well.
In my case it doesn't auto-complete my Parse Objects at all...
PFQuery(className:"User").getObje // Doesn't propose any completion, compilation works well
Someone solved it ?
I faced this problem in xcode 7 beta 2. The solution is to specify to xcode the directory in which the framework is located. You can do so by clicking on your project, then choosing Build Settings and search for "framework search path" after that double click on the right side of the row and click the plus sign and add the path to the directory.
NOTE: DON'T choose recursive way. This will not work. just specify EXACTLY in which directory is the Parse framework that is used in your project located.

Code Sign error: Provisioning profile can't be found

I have been working the whole day to try to build my app on my device.
I get this error when I try to build on my device.
I have been reading about this problem but do not really understand how to fix it. The following is where I would believe the problem is. I am new on this so I have no experience how to solve this.
When I open the "Dont Code sign" I have "Automatic profile selector (recommended)" with two lines I can select and also "My profile for dev" with one line to select. Do not know if this is where the problem is?
Any help is appreciated.
Here's how I did it.
Shut down Xcode.
Back up the project.pbxproj file.
Edit the project.pbxproj file and remove lines of instances where it mentions the old provisioning profile.
eg. Delete line:
PROVISIONING_PROFILE = "8D024EDA-DC05-40DF-B3EB-536392615EE2";
Restart Xcode and perform a full clean of the project.
It should then build without warnings.
Enjoy!
In my case it was because the xcode 4.0.2 prevented deletion of stale data in the project.pbxpro in the *.xcodepro directory. I ended up hand editing the file after shutting down xcode. In the file I looked for all of the occurrences of "PROVISIONING", something like this:
PRODUCT_NAME = Xyzzy;
PROVISIONING_PROFILE = "CF5F0AEA-92D9-48E1-99DF-301AB36C2BFB";
"PROVISIONING_PROFILE[sdk=*]" = "CF5F0AEA-92D9-48E1-99DF-301AB36C2BFB";
SDKROOT = iphoneos;
and changed it to:
PRODUCT_NAME = Xyzzy;
"PROVISIONING_PROFILE[sdk=*]" = "";
SDKROOT = iphoneos;
I restarted xcode and the build succeeded with out issue. A word of caution make sure that you back up the project directory before make changes to the project files, and only hand edit the files when you have no other options.
I went and changed code signing identity the on project and target to "Don't Code Sign" and then changed back to the correct code signing identity. That fixed it for me.
what exactly is the error message?
Did you add your device including the required provisioning profile in the organizer? What do you see in the organizer when selecting your iPhone under devices? It should be there with the correct valid profile...
If you are working with a project created by someone else as a template, you need to change the code signing identity
screenshot: http://i.stack.imgur.com/UIpGS.png (Xcode 4.2)
ps. OSX would not let me edit the .pbxproj file with a text editor
I had this problem when I had to reissue development provisioning profiles with new names/ids.
The solution was to update all references in Edit Project Settings | Build (Code Sign) referring to Code Sign Developer (name). (Not Edit Active Executable.)
Click on the item(s) and check that the new profile is explicitly selected, and rebuild and run.
I suspect that the reason you get this error in the first place depends on whether or not you have set xCode up to try to resolve these dependencies automatically. In one of my builds replacing the profile was seamless - in the other I had to manually update it. Clearly the best solution would be a seamless one.
I've had this before, and it just worked by restarting Xcode. Probably won't work for you but I'll throw it out there anyway.
I had same error where the very previous build built just fine. I noted that my Build Settings -> Code Signing -> Provisioning Profile had been reset to strange one. All I had do is to point it to correct one to resolve the issue.
This one can be fixed by changing the project settings AND clicking Project > Edit Active Executable > Build and changing the settings there.
I just redid my provisioning profile and re-added devices to the portal in Organizer. Then I clicked my project icon, entered Build Settings, Code Signing and remapped to the new provisioning profile.
I had the provisioning profile set to one thing in Projects and another in Targets. Do a search in your project for the file that is missing and see if it pops up. No hand editing needed!
Like #Jonathan, I just restarted Xcode and it worked after it automatically retrieved the profile from my Apple developer account. This was Xcode 6.2

Restore Project Settings in XCode

How can I restore Xcode project settings? I can't see few settings (like Targeted Device Family, iPhone OS Deployment Target, etc.) after I gave my Macbook to my friend. :(
I also saw that the info.plist file was not in the project, I recovered it via TimeMachine though, the Base SDK is also missing. :( She messed all things up, I don't know why she went in there. Anyways, is there any way to restore the settings?
Unfortunately, the snapshot that I have is also very old. :(
No way to restore them. You can set the base sdk on the project info screen.
Project > Edit Project Settings > Base SDK, Check the same for your Target.
Is this issue occurring for a specific project, or all projects? If you create a new project, what happens?
I forget the exact syntax, but different versions of XCode handle project files slightly differently. A new SDK (and version of XCode) couldn't read my project file right (same symptoms you explain).
In my case, there were 2 different SDK settings in the project file due to 2 separate versions of XCode editing the file (this could be very likely if you restored from backup and had upgraded SDKs in the interim).
Look for something like:
SDKROOT = iphoneos4.2;
Or really, just look around the text that contains the build settings (all of your build settings are stored in the file in flat text) -- you may see something related to SDKs where there are 2 lines very similar right next to each other. That'd probably be your problem. If you don't know which to delete, try both and then re-set the setting using the interface.
Of course in any case, you should back up your project file (project.pbxproj) before trying any of this.

Xcode Project Code Changes Not Updating 100% After Save-Build-Run

When I make code changes to my iPhone game project in Xcode, and then do CMD-B + Enter, I expect the project to be saved, build and run on the simulator with the latest. What is happening though, sometimes, is that it doesn't pick up a small change I make unless I clean the project and then build.
I'm a long time Java person and newish to C-based languages and it's compiler. Can someone explain to me what is cached after each build that does this and how to change my project settings to avoid having to clean every time? Or tell me the bad news that this is part of C development? Not trying to bash it - I get compiled JSPs stuck in the working cache often in Java, too. :P
UPDATE: Does this have to do with the location of my builds at all? That's the only thing I can think of that's changed from a build config perspective.
Had a similar problem, I reset content and settings in the iPhone simulator
Seems odd to me, because I never get this problem in XCode. It's not a common issue with C or anything. The tools for C-based languages usually do this just as well as the Java ones.
Go to Product Menu and choose Clean and then choose Build. Thats it.
In the Xcode Build Preferences make sure that "Unsaved Files" is set to "Always Save". If not, Xcode will not autosave files before building and will use the last version saved to disk.
In case anyone still comes across this (as I was having this issue today on Xcode 5.1), all I had to do was open a new tab and close out the tab I was working in. Some sort of tab bug in Xcode.
I am not sure about this, But in case if you are using git, go to xcode preferences -> Source control -> General
Uncheck Refresh local status automatically
Uncheck Fetch and refresh server status automatically
Uncheck Add and remove files automatically
Uncheck Select files to commit automatically

Build Error - missing required architecture i386 in file

I'm getting this error when building my iPhone application:
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library
/Frameworks/UIKit.framework/UIKit, missing required architecture i386 in file
It goes the same for all the frameworks in my app. It's very weird since this was not happening earlier.
This happens when you add a framework to your project and unintentionally copy the framework into your project directory.
The fix is to check your project directory (where you store your project on disk) for any iphone SDK *.Framework files and delete them.
Project will build fine afterwards.
I had this same problem, and the solution turned out to be an easy fix. Backup then open project.pbxproj (located inside your project file bundle) in TextMate or TextEdit and search for the section titled "/* Begin XCBuildConfiguration section */". Look for a key named FRAMEWORK_SEARCH_PATHS and delete it and it's contents (once per build configuration, so I removed it in two places). Here is an example of what I deleted:
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks\"",);
My project now build for both the iPhone device and the iPhoneSimulator.
What has happened here is that Xcode has mysteriously added a "Framework Search Paths" entry that points to a particular iPhone device SDK. For example, mine was recently set to:
$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks
This leads the compiler to find frameworks of the incorrect architecture. Removing any values under the "Framework Search Paths" key in your target's build settings will resolve the issue.
I just wanted to mention that in XCode if you go to "Edit Project Settings"
and find "Search Paths" There is a field for "Framework Search Paths". Updating this should fix the problem, without having to hack the project file!
Cheers!
Jesse
Check that you didn't copy the framework into your project when you added it. If you copied it, it can't find the original paths. To fix this problem. Delete the AVFoundation framework from your frameworks folder in your project, then add it again, but this time, make sure you don't have copy check marked.
This fixed it for me!
I fixed it in a different way.The reason why i was getting this error was that i added security.framework twice in my project.I was not able to see security framework in xcode ,i opened the project in finder and found this framework which i deleted and problem solved.
If your app is meant to run on the device, make sure you are not trying to run in it on the simulator. May sound obvious, but check anyway.
Though it is possible that something got deleted, it has been my experience that something gets screwed up in the project file. I have yet to pin down what that "something" is. I've had similar issues when the SDK installation is just fine. There are a couple of options.
First, add all of your files to a new project. This seems to usually work. Kind of a pain, though.
Second, you can right-click project in XCode/Get Info/Build/Library Search Paths. Add new paths similar to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/lib. Add appropriate versions of that string for each version (2.2.1, etc) and platform (simulator or iPhoneOS). Perform a similar action for Framework Search Paths if frameworks are your problem.
Third, which is more work but more reliable, is to open project.pbxproj from within MyProject.xcodeproj (Textmate is good for this). Look for "/* Begin XCBuildConfiguration section */", then "LIBRARY_SEARCH_PATHS" and "FRAMEWORK_SEARCH_PATHS". Add or modify the paths as appropriate, and save the file.
In any case, a pain in the butt, and I'd sure like to pin-point the cause because I've had this happen a couple of times. Project builds fine, then just up and refuses to do so with what seems to be little reason.
"Edit Project Settings" and find "Search Paths" There is a field for "Framework Search Paths". delete all!!
It just happened here to me as well. Thanks to a great partner we found the answer. Your Xcode may be pointing to the simulator ..change it to a IOS device instead ..built smooth after ....
Run the file command on the framework from Terminal:
file /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library /Frameworks/UIKit.framework/UIKit
You should get back a message telling you which architectures the UIKit binary is compatible with. If you don't see "i386" listed, then you've somehow managed to remove the i386 version of UIKit, which will mean that you can't build for the simulator.To fix that, you'll have to re-install the SDK.
If you get some other error, hopefully it'll help you figure out what the actual problem is.
I just want to let you know that In my case, I was having the same problem, I realized that I had an older Xcode folder called Xcode3.1.3 I just rename it because it was an older version and that did the magic for me.
Check your library search paths in your target settings. Sometimes goofy libraries get entered in there and this will give you a similar error.
You can remove all entries in this section.
I'd just experienced something slightly different, because I work on my own library (WM_GSRecognizerLib), but the error is the same.
What'd happen: due to some updates, the path targeting the lib to include (.a) was from the "Debug-iphoneos" folder (where it is generated). Compiling for Generic iOS Devices worked fine, but not for simulator, complaining for the missing i386 architecture.
What I did for this issue, is to also include the binaries from the "Debug-iphonesimulator" folder.
It can help for this topic, because the explanation is here: devices require binaries for arm64/armv7/armv7s, while simulator does need i386.
My solution was to set on simulator target debug YES, just look on git status to see the new line added as architecture only on .project. if you don't set this the build will run to all architectures and will show some missing architecture like i386 or other.
NOTE THAT obviously the main issue is to use some framework that implements some kind of specific architecture.
I too got the same error am using xcode version 4.0.2 so what i did was selected the xcode project file and from their i selected the Target option their i could see the app of my project so i clicked on it and went to the build settings option.
Their in the search option i typed Framework search path, and deleted all the settings and then clicked the build button and that worked for me just fine,
Thanks and Regards