Failed to launch simulated application: Unknown error - iphone

OS X 10.5.7 (genuine Mac)
Xcode 3.1.3
iPhone SDK 3.0
When I try to execute my iPhone application in simulator, I get the dreaded error message:
Failed to launch simulated application: Unknown error.
My application has two targets, but this error occurs on both of them.
When error occurs, the simulated OS hangs — it displays black screen and no longer responds on any input. Simulator application itself does not hang — all menus are active.
All other applications I've tried running (mostly Apple samples) do work fine. Purging of caches, rebooting and howling on the Moon did not helped. Rebuilding project from scratch did not helped either. I guess I have to do it again in smaller steps.
Meanwhile, are there any other things to try than these below?
Xcode | Empty Caches...
Delete directory /Library/Caches/com.apple.DeveloperTools.###
Full rebuild
Reboot
Change the product name (it did not contain any spaces anyway)
Create new project and configure it manually from scratch
A quote from the system.log:
12.08.09 0:13:59 [0x0-0xa70a7].com.apple.iphonesimulator[5368] -[MonitorController forwardEvents]: unable to send msg to ffffffff: 10000003
12.08.09 0:13:59 [0x0-0xa70a7].com.apple.iphonesimulator[5368] -[MonitorController forwardEvents]: unable to send msg to ffffffff: 10000003
12.08.09 0:14:03 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Unknown key for integer: JetsamPriority
12.08.09 0:14:03 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 0:14:03 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 0:14:03 vot[9750] ******** AX INSPECTOR MODE ************
12.08.09 0:14:03 vot[9750] VoiceOverTouch exiting because accessibility is not enabled. To enable do this: 'defaults write com.apple.Accessibility AccessibilityEnabled true'
12.08.09 0:14:03 Xcode[9079] Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x39251e0 "Unknown error."
Note that something called VoiceOverTouch is mentioned in the log. My application does not contain (to the best of my knowledge) anything related to accessibility (could be brought in by some dependency though). I've enabled accessibility on my Mac as suggested in error message, but it did not helped. I've enabled Accessibility Inspector in the iPhone simulator. VoiceOverTouch message no longer appears in logs, but the Unknown error persists.
New logs:
12.08.09 11:01:20 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.AXInspector[10808]) Exited: Terminated
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Unknown key for integer: JetsamPriority
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 11:01:28 vot[10812] ******** AX INSPECTOR MODE ************
12.08.09 11:01:28 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x2e9b930, has non-zero refcount = 1
12.08.09 11:01:28 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x495e240, has non-zero refcount = 1
12.08.09 11:01:28 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x2e9b930, has non-zero refcount = 1
12.08.09 11:01:28 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x495e240, has non-zero refcount = 1
12.08.09 11:01:28 Xcode[10200] Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x49b0060 "Unknown error."
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x44e4ba0, has non-zero refcount = 1
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4537820, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x44e4ba0, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4537820, has non-zero refcount = 1
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4775400, has non-zero refcount = 1
12.08.09 11:01:29 Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x478fa20, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x4775400, has non-zero refcount = 1
12.08.09 11:01:29 [0x0-0xbf0bf].com.apple.Xcode[10200] Xcode(10200,0xb0103000) malloc: free_garbage: garbage ptr = 0x478fa20, has non-zero refcount = 1

Recreating project step-by-step showed that it was directory structure.
I've had directory named 'resources' with resources for my application. That directory was added to the bundle as is (via Folder References feature).
When I renamed that directory to less common name, error went away.
So, never name any custom directories in the bundle 'resources'.
Guys from Xcode (or simulator) team could improve their error reporting. I've had to spend whole day debugging this issue. :-(

I just encountered similar error after cleaning up our XCode projects and updated them to use XCode config files. It occured only to one of our iPhone application targets, not all of them.
XCode said
Error from Debugger: Failed to launch simulated application: Unknown error.
In Console, only information was following two lines:
30.9.2009 14.31.19 com.apple.launchd[99] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
30.9.2009 14.31.19 Xcode[13827] Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x389db50 "Unknown error."
It turned out that I had accidentally deleted Info.list file build setting from the target and neither XCode nor iPhone simulator could emit any useful error message about that. Adding a build setting again fixed the problem.

Looks like this is your key bit (doesn't normally come up in system log):
VoiceOverTouch exiting because accessibility is not enabled. To enable do this:
'defaults write com.apple.Accessibility AccessibilityEnabled true'
Your app has some dependency on accessibility being enabled. Suggest you follow the instruction and run the bit in quotes on your system console.

I'm worried about these two lines:
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.apsd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
12.08.09 11:01:28 com.apple.launchd[166] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Path monitoring failed on "/var/mobile/Library/Preferences": No such file or directory
It appears to me like your Xcode (specifically, the iPhone Simulator) installation is broken somehow. I'd suggest saving all your important files and reinstalling the SDK.

I had a similar issue with a different solution: some of my .xib files had a deployment target (2.0) that was no longer installed on my machine.
The solution was to open the xibs in Interface Builder, do cmd-opt-I to get the project info for each one, and make sure the deployment and development targets were set to correct versions.
I then did cmd-shift-K to clean the project in XCode, rebuilt, deployed, and everything seems to work fine.

Nothing above helped me - I went through all the suggestions. What eventually fixed it was deleting ~/Library/Application Support/iPhone Simulator. I then compiled and ran my app in the Simulator again, it recreated the directories, and my app ran fine. None of the accessibility or missing file errors were relevant.
To add to the above, i've had to resort to just creating a new project in my latest version of the SDK (this problem only raised its ugly head when I upgraded to 3.1.3). I then had to copy all my source files and resources over and reconfigure the build settings etc. This seems to cure the problem but it was a bit of work!

I was getting this problem when I had my Info.plist file set to export to the target. You might want to check that, de-selecting that option fixed the problem for me.

After an update of the SDK I had the same problem. None of the tips worked for me. Finally I´ve noticed in the plist file there was a space character after ${EXECUTABLE_NAME} which caused the problem.

I had a similar issue. I was also unable to install the app on a device, getting a 'The application bundle does not contain a valid identifier." error message. This was due to a directory named "Contents" added as a Folder Reference. I removed the reference, renamed the directory, add it again as a Folder Reference, clean the project, rebuild and voilà, I was able to launch the simulator.

I use the Rename Project option to change my project's name and everything worked after that. I think we're all dancing around any number of methods of "fixing" whatever internal files XCode uses to track what it's doing. Pretty frustrating bug.

Another reason for such an error message: a number in the executable file name (set in the projet plist file under "Executable file" key). The solution was to remove any number there, remove the application in the simulator, quit and relaunch xcode, rebuild, and tada, it's that simple :-(

For what it's worth, after reading this thread, I decided to just delete my targets and recreate them. Problem went away.
EDIT:
After thinking I had finally found a way of working through this, I discovered I still had issues.
The only surefire way I discovered to fix this issue is to create a new project from scratch. Then when adding new targets, rather than adding a new target, duplicate the existing target.
One thing I have noticed is that if the Project and the Targets have the GCC 4.2 settings on their settings page than everything seems to work fine. If, however, those settings are missing and instead is a section called 'User-Defined' than all sorts of weird errors occur.
I have no idea whether those settings are a symptom or the source of the problem. I have also discovered no way to consistently get the settings page to switch.
One solution, that I have seen work sometimes (but, also seen not work many other times) is to switch the active target to Device while a device is plugged in. In certain cases this causes the correct settings to load. Then when you switch back to Simulator the correct settings are still there and everything seems to work fine.
I believe I have also noticed the following: My original project file had the GCC settings on the Project Settings page. One of the targets had the settings and worked, the other target didn't and didn't work. I deleted all of the targets and re-added two new targets. After this the GCC settings disappeared on the project settings page and were also absent from the settings pages of any targets that I created. Nothing I did could change that. Any of the targets I tried to install in the simulator result in the simulator showing a black screen with an error message simply saying failed to run in the simulator with an unknown error.
Attempting to run those same targets on the device failed instantly without ever even attempting to compile (even after cleaning all targets) with an error saying something about invalid file.
I'd really love to know what's going on, but after 6 hours of no progress, I gave up and simply recreated the project and the targets as described above and everything works fine.

I believe that ultimately there are a spectrum of issues at play here. Some may be resolved by clean & rebuild, deleting preferences, etc.
None of these help resolve my issue.
I discovered that I had added some 3rd party code to my app that contained 1.) XIB files for their sample app and 2.) an info.plist file both of which erroneously had been added to my target.
Removing the XIB did not resolve the issue, but removing the info.plist file did.
Check your targets carefully and ensure that the assets that are being built and bundled are in fact needed.

I had the same issue. I had a lite scheme and a full version scheme. Neither radio button was selected under Launch. I wish I had taken a screenshot when it was in this state. As soon as I clicked "Automatically" it worked just fine.
Seems like a pretty glaring issue with XCode 4.

I had the same problem. Turned out the Info.plist was "missing" and had to be explicitly declared in the project settings. For some reason using the default name wasn't enough.

Related

Swift error in fallback scratch context: error: failed to load module 'AppName'

When I add a breakpoint in code, then I try to po something in lldb I get this error once, and it gets away after printing the variable again.
warning: Swift error in fallback scratch context: error: failed to load module 'AppName'
note: This error message is displayed only once. If the error displayed above is due to conflicting
search paths to Clang modules in different images of the debugged executable,
this can slow down debugging of Swift code significantly,
since a fresh Swift context has to be created every time a conflict is encountered.

Invalid diagnostics signature

When I build my project and I don't know how, I got this type of warning:
Could not read serialized diagnostics file: Invalid File: Invalid diagnostics signature
It is just shows the name of class but did not mentioned any location.
Any advise?
This is new as of Xcode 11.5, as far as I can tell, and it happens when you interrupt a running build. The warnings disappear when you let a new build run to completion.

Oprofile not finding libraries

I'm trying to use OProfile on Eclipse (3.8). The Juno version of oprofile didn't work, so I installed the Luna one. This one at least starts up, but can never find the libraries.
Here is the error:
ns3-dev-lena-profiling-debug: error while loading shared libraries: libns3-dev-lte- debug.so: cannot open shared object file: No such file or directory
profiled app exited with the following status: 127
I know that that means I need to add the library path. So I went to Profiling Tools Configurations, and specified the path under environmental variables as:
name: LD_LIBRARY_PATH
value: {workspace_loc:ns3dev2}/build (appended)
I manually checked and the library is located in the build folder. Furthermore, this library path works fine if I debug the same project instead (or run it...).
I've deleted the configuration and remade it, but it's the same error.
I also tried adding the same path to PATH instead of LD_LIBRARY_PATH, but that doesn't make any difference. (Just tried it for the hell of it).
Any thoughts?
Edit, I get the same problem on Eclipse 4.4 (Luna). I found the logs for the errors and the error is:
!ENTRY org.eclipse.linuxtools.oprofile.core 4 0 2014-10-27 12:33:07.200
!MESSAGE opreport process error output: warning: /no-vmlinux could not be found.

Struggling with Xcode 4

I've recently downloaded Xcode 4 and now two of my projects that were working perfectly fine before have started giving me errors. Both errors are effectively to do with linking options, but I can't figure out how to change these options and get rid of the errors.
The first problem is with a project written in C++ using the SDL_ttf and SDL_image frameworks. The project builds correctly, but when I try to run, it gives me the following warnings on the console:
warning: Unable to read symbols for #executable_path/../Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf (file not found).
warning: Unable to read symbols from "SDL_ttf" (not yet mapped into memory).
warning: Unable to read symbols for #executable_path/../Frameworks/SDL_image.framework/Versions/A/SDL_image (file not found).
warning: Unable to read symbols from "SDL_image" (not yet mapped into memory).
Since the files are not being found, the executable cannot load any images making it exit straight away when I try to load images. I think the issue here is that the frameworks are not in the directory above the executable, they are in /Library/Framework/ which worked fine before in Xcode 3.2. How do I resolve this?
The second problem comes when compiling an application I wrote for iOS. Along with giving me a bunch of warnings about depracated code on iOS 5, which I will deal with later, it fails to build due to a linker error which I have no clue how to resolve, it says:
ld: library not found for -lz.1.2.3
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
I can answer the second question.
-lz.1.2.3
should be
-lz
You might have accidentally added the zlib.1.2.3.dylib to the project's "link binary with libraries" build phase. You should use the standard zlib without any version in its filename, or simply add -lz to the Other Linker Flags under Build Settings and not add zlib in the "link binary with libraries" build phase.
As for the missing frameworks my best guess is that it has to do with the relative path, ie if you can get rid of the /../ part and instead provide an absolute path that might resolve the issue.

Unable to read symbols error

I get these errors when I build and run for the device. Should I be worried about them? The app runs fine.
run
Running…
[Switching to thread 10755]
[Switching to thread 10755]
warning: Couldn't raise load state for requested shlib: "libobjc.A.dylib" for breakpoint 1.
(gdb) continue
warning: Unable to read symbols for ""/Users/tim/Code/Cat War/build/Debug-iphoneos"/Tiger War.app/Tiger War" (file not found).
warning: Unable to read symbols for ""/Users/tim/Code/Cat War/build/Debug-iphoneos"/Tiger War.app/Tiger War" (file not found).
You probably turned off debug symbols in the build settings. They should be off for release but they are helpful for debuging.
Hmm. I get this as well, but only when testing on the iPhone or iPod touch. Also, for my Debug Target Config settings, "Generate Debug Symbols" is set. (Not much in the Xcode project was changed in terms of the build settings, and I suspect it wasn't in yours either ... ?)
By any chance do you have an objc_exception_throw breakpoint in play? I have these two in my global breakpoints group:
[NSException raise] (CoreFoundation)
objc_exception_throw (libobjc.A.dylib)
Perhaps there's a correlation?