Xcode 4 Scheme Hell? - xcode

I have a serious ongoing issue with Xcode 4. I have been using Xcode 3 for years, and had everything set up perfectly. All my Build Configurations worked A-OK.
I updated to iOS 5 GM, and naturally I have to use Xcode 4 to submit my app to the Store or use TestFlight. I can't change my Build Configuration. I've tried making a new "Scheme" (which are stupid IMHO, when the old system worked 100%), and everytime I do, I set everything the same, I go "Product" > "Archive"....it works, and I share the IPA to my Desktop, to upload it to TestFlight, or I save it as a ZIP and send it to Application Loader.
IT NEVER WORKS. On TestFlight, my testers will install it, and immediately the application will crash. It won't even launch, no matter how I build the app, regardless of Scheme. It worked 100% and I have made ZERO changes since updating to Xcode 4.
Xcode 4 only works when I wish to "Debug" my app on my own device. It builds, installs and runs perfectly. Why won't it work on AdHoc or App Store?
PLEASE HELP! I'm ready to pull my hair out.

To answer this question, it was an absolutely STUPID issue!
I was checking the size of my Info.plist for any changes, and for some ridiculous reason only Apple can comprehend, updating to iOS 5 made that code obsolete. So the use of the code in my Release/AppStore/AdHoc builds was making it crash on launch. Once I commented the code out, everything is back working 100%.
Strange.
Even Apple Technical Support couldn't figure it out and they had my whole project to peruse. Apple REALLY need to improve their software when they change it. Not create a massive learning curve for their users and encourage code-cleanups if the SDK decides it doesn't like 4.3 code.

Related

Remove support for Apple Watch on app store

I removed the embedded app extension for my watch app, and the target dependency so that my app would discontinue support for the apple watch.
The app never quite worked, and the more my app evolves the less the apple watch does for the user.
After removing these things I attempted to install the build on my phone. It never was able to do so, until I deleted it.
I tested this using testflight.
The app won't install. It downloads, then sits at about 90%. Will NOT update
How then am I to remove support for the apple watch????
This answer may seem weird as it does not have to do with apple watch at all, but I have had the issue you've had with installs not finishing before. I was really stumped as to what it could be, looking into all of my extensions as you are doing now.
It ended up being that I had placed leading zeros in the version number/build number.
For example: Version 4.01
Instead of: Version 4.1
For some reason this caused the error you described for me. Can you confirm you don't have any leading zeros?

Difference in behavior between Xcode and OTA Ad-hoc distribution

I have my app working to my satisfaction both in the simulator and on two devices when debugging through Xcode 4.3.2. I use OTA Ad-hoc distribution to send to my beta testers. After archiving, saving, and uploading my ipa and plist file to my website, I then download and successfully install the app on my phone.
Sounds good, right?
HOWEVER, I am using CoreAudio and CoreData, and low and behold suddenly there is no sound in my app. I delete and install OTA on the same devices I am debugging with, so I am at a loss to where the problem is occurring.
I have a feeling that there might be an underlying problem with my Core Data model (which feeds my sound) but checks upon checks seem to verify that it is working. It DOES work when I install from Xcode, unplug, close, and reopen the app on the device. Only the OTA install has this problem.
Has anyone encountered any differences in behavior like this? I checked my build settings and the only difference I see for AdHoc is using the Entitlements.plist, which only useful setting appears to be NO to debugging.

Xcode 4.4 - There was an internal API error

Hi I just upgraded to Mountain Lion. I created an empty Single View Application and run it. The first time it runs fine but the next runs will give me the "There was an internal API error" pop-up warning TWICE. It's the same with my other projects. They run okay once but gets this error the next runs. There was no warning or any specific warning message of any kind.
Any idea how to solve this?
Would really appreciate your help.
I have it working on iOS6 Beta 4!! This is what I did but other variations may also work:-
Install XCode 4.5 Developer Preview 4
Delete your app from the device
Run your app from Dev Preview 4
Delete your app again (not sure if you have to do this)
Return to XCode 4.4.1
Run your app, stop running, run again!!!
Of course you could continue developing in 4.5, but I prefer to wait.
Installing 4.5 Beta 4 installs updated device support. Once this is done once (possibly on any device) it should work fine. If you use the same device on a different machine you will have to again run it once from 4.5 Beta 4 before using your preferred version of Xcode (You do not need to delete the app from your device this time).
Edit: I am pretty sure that if you make a change to your core data you will need to run from 4.5 for the first time also.
Don't know if this helps, but I've deleted all files in ${HOME}/Library/Developer/Xcode/iOS DeviceSupport and it worked as a charm (Xcode 4.4.1, OSX 10.7)
I had this problem when I upgraded my device to Preview4 but had my MBP still running Xcode Preview3. Updating to Xcode Preview4 made the problem go away for me, no restarts necessary.
Deleting the app manually from the device/simulator will allow you to build and run successfully. A long term solution is to not use a Beta Xcode :)
Sounds crazy but you can also not use the Beta version of XCode 4.
However, you must keep it in your left hand to authorize your iPhone to compile with the non Beta version (don't ask me why, it works).
If you run your app with XCode 4.5 preview & IOS6 Beta 4, the second time you run your app on the device, you'll get the internal API error.
In theory, you cannot use XCode 4.4 to compile on your iOS6 Beta 4 iPhone.
But...
It seems that, if you launch XCode 4.5 Preview, connect your iPhone (so it is recognized), run the application on it (even if you get the error), quit XCode 4.5, launch XCode 4.4 and .. tadaaaa... your iPhone is now recognized as an authorized device to compile on...
And of course, XCode 4.4 doesn't generate the api error...
I have Xcode 5.0.2 and iPhone with iOS 7.0.6.
Every time when I launched my project on iPhone, I saw "There was an internal API error". And it was launched on simulator without any problems.
I did all the stuff that usually helps (like remove an app, clean, restart Xcode, restart a mac, etc.).
This problem went away only after I restored the iPhone. Sad but true.
I don't know so far, why it appeared.

Xcode Instruments is stripping symbols despite all build settings to the contrary

Problem
Instruments' Time Profiler is stripping all symbols except system libraries from my app, despite the fact that I have disabled this behavior in all relevant build settings in Xcode — but only on one development machine. The other dev machine behaves normally.
Description
Instruments' Time Profiler is stripping all symbols except system libraries, despite the fact that I have disabled this behavior in all relevant build settings in Xcode — but this is only happening on one of my development machines. I have two development machines running the same version of OS X, Xcode, and Instruments, and each machine is using an identical copy of the same Xcode project with identical build settings, schemes, and other configurations, and the app is profiled using the same test device (iPhone 4S with the latest public version of iOS 5).
Machine 1
- Mac OS X 10.7.4
- Xcode 4.3.2 (4E2002)
- Instruments 4.3 (4321)
Machine 2
- Mac OS X 10.7.4
- Xcode 4.3.2 (4E2002)
- Instruments 4.3 (4321)
Steps To Reproduce
Open included sample project on each machine.
Make sure the iPhone 4S is selected as the test device.
Select Product > Profile
When Instruments launches, select Time Profiler and continue.
Run the app.
Notice how the symbols are stripped when running on the iMac (Machine 1) but not on the MacBook Air (Machine 2).
Expected Behavior
Symbols from my own code should appear in the Time Profiler on both machines.
Regression
I have tried all of the following, with no change in the actual results:
Rebooting the machine.
Trying other Xcode projects
Deleting the "Derived Data" for all projects in the Xcode Organizer.
Re-symbolicating the document in Instruments (carefully selecting the correct DSYM file in ~/Library/blahBlahBlah…)
Final Notes
Here is a link to a .zip file of a sample project: Sample Project .zip
I was finally able to get it to work by a method that's just shy of a nuke-and-pave scenario:
Make absolutely sure all symbol stripping is disabled for your current build configuration. Make sure you've done this for your Release config if that's what's being profiled for Instruments.
Delete the app from the iOS device.
Restart the iOS device.
Restart the Mac (I don't trust Xcode or Lion at all to quit all relevant processes otherwise).
Launch Xcode, go to Organizer > Projects and delete Derived Data for the affected project.
Clean your project. Hell, why not?
Build and profile for Instruments.
Choose the Time Profiler in Instruments for clarity.
The first run will not show the symbols, but don't quit. Leave Instruments running!
Re-symbolicate the document in Instruments, navigating carefully to the correct dSYM file for the current build. This should be easier since you've deleted the derived data in step 5.
Now you should be able to see your symbols. It helps if you hide non-objective-C symbols.
Why do I suggest that you delete the app and restart the iOS device in Steps 2 and 3? I have a suspicion that Xcode doesn't perform a clean installation of each build, but may install deltas, such that the symbol addresses present in Instruments are a mixture of the current build plus previous builds. If so, then this issue is even more common for someone like me, who shares a single test device between more than one Mac. This assumption could be wildly incorrect.
If the above steps don't work for you, please let me know in the comments. I'd like to create a detailed radar report at some point in the future.
I'm not sure that it has been fixed in the 4.3 but this is a known problem in 4.2 seen here
Instruments
There is a known issue with the Profile action from Xcode 4.2. After a build in which no source files have changed, Instruments will be unable to gather symbols for the target application.
This affects projects where both:
The Release configuration is selected for the Profile action.
(default)
The Strip Linked Product build setting is set to "Yes”, or
a custom Run Script build phase strips the product. (non-default)
The workaround is to do any one of the following:
Perform a "Clean" on the product before initiating the Profile
action.
Do a Clean of the product and temporarily set the Strip Linked
Product build setting to "No" while Profiling.
Set the configuration of the Profile action to Debug.
Run successive profiles directly from within Instruments when you do
not need to rebuild. When developing Mac apps, using the GC Monitor
template in Instruments may cause Instruments to crash. To
workaround the problem please consider migrating your application to
ARC.
I've had a similar problem for days. I was able to profile the Debug configuration, but not Release. First I tried to make a copy of the release configuration (as suggested somewhere on the web), but that copy did not work either.
Then I made a copy of Debug, called it Profile, tried it and the symbols of Profile were shown in the profiler. Great! I then changed the optimization levels etc. to the same as Release, and now it works! Just wanted to share this, as this comment would have spared me hours...
Have been facing the same and stumbled upon this thread.
I realized that I first profiled the app with release build and after changing the scheme in Xcode for the same app, the profiler was still unable to symbolize. I have tried all obvious solutions you mentioned above but in vain.
The profiler somehow is still referring to the first build (release build)'s settings and hence it is not able to symbolize. So, I just changed the app's bundle identifier for testing purpose so that a new app is created altogether for profiling purpose. I could check the code where leaks exist now.
Try it out and let me know if this works for you too. Still pondering over why Instruments is failing to symbolize though.
I had a similar issue where I had no symbols in my os x application that I built from the command line (so in this case it is not an iphone or xcode issue). It turned out the problem was due to a bad DYLD_LIBRARY_PATH that contained my PATH. When I got rid of all those non-library paths, such as /usr/bin/, it worked.
I have a lot of third party frameworks whose symbols and binaries are unfortunately getting lost.
Additionally, my app's binary was getting lost.
I.e. if I selected File > Symbols, clicked my target, and found the similarly named item, the Binary Path was showing up red.
The solution was to go to Instruments > Preferences > Symbols, and add /Users/<MY_USER>/Library/Developer/Xcode/DerviedData to the search paths. Library is not indexed by Spotlight. After doing this, I have at least had the symbols for my app. The little circle next to my app's name goes from Yellow to Green when I do this, and persists between restarting Instruments, unlike other solutions to manually set the binary.
Let me know if you can tell me how to get all the ones for my third party frameworks. I use Carthage for some, others installed manually. Have had no luck with these yet.
I've managed to solve this by:
Disconnecting the device
Deleting the iOS Device Support files for the device's version of iOS in ~/Library/Developer/Xcode/iOS Device Support
Reconnecting the device and letting Xcode reinstall device support.
To be safe I first quit Xcode and Instruments, deleted derived data, and did a clean build as mentioned above, but no need to delete the app or restart any devices this way.
Try open XCode 3 and him Organizer. And try add from this Organizer a devices to both machines.
Just open Organizer and wait him processes. If you're see a button "Use for development" then click him.
Sometimes, XCode 4 can't add a device a truely for full development.

Xcode/Phonegap not compiling the right version of my app

When I compile my mobile app using Xcode and Phonegap, the application on the iPod/iPhone/iPad is the anterior version that I compiled yesterday.
Basically when I run the app in the emulator, all works fine, so I know it's the right files and everything, but when I then build it for the mobile device, it shows the one I did yesterday.
What could be causing this? Is there any settings I should check or something? Like I said I doubt it's related to the files/folder because when emulating it, it works fine.
Thanks!
I had a similar problem long time ago. Try to delete your app on the device and then build it again. I don't know how apple manage apps but I think that the major of your app is keeped on your device (in order to speed up compilation).
I hope it will works !
Did you increase the version number of your built? If you recompile with the same number, you may run into trouble.

Resources