Startup crash on iOs simulator after installing Xcode 6

Problems building or running the engine, queries about how to use features etc.
Post Reply
fd9_
Halfling
Posts: 64
Joined: Wed Aug 20, 2008 9:20 pm
x 22

Startup crash on iOs simulator after installing Xcode 6

Post by fd9_ »

After installing Xcode 6, there seems to be a problem with running my application on the iOS simulator. The code crashes on startup with this error:

Code: Select all

An exception has occurred: OGRE EXCEPTION(0:IOException): Cannot create settings file. in Root::saveConfig at /Users/davidrogers/Documents/Ogre/ogre-v1-9/OgreMain/src/OgreRoot.cpp (line 395)
The problem seems to be with this code from the framework:

Code: Select all

#ifndef OGRE_STATIC_LIB
    pluginsPath = m_ResourcePath + "plugins.cfg";
#endif
    m_pRoot = new Ogre::Root(pluginsPath, Ogre::macBundlePath() + "/ogre.cfg");
    
#ifdef OGRE_STATIC_LIB
    m_StaticPluginLoader.load();
#endif

	if(!m_pRoot->showConfigDialog()) /// crashes here
		return false;
	m_pRenderWnd = m_pRoot->initialise(true, wndTitle);
What's odd is that the simulator ran fine prior to installing XCode 6, and the crash only occurs on the simulator, not the device. Obviously the code is crashing because it's trying to look in a folder that's not mine, /Users/davidrogers/, but Ogre::macBundlePath() appears to be the correct path.
fd9_
Halfling
Posts: 64
Joined: Wed Aug 20, 2008 9:20 pm
x 22

Re: Startup crash on iOs simulator after installing Xcode 6

Post by fd9_ »

So it appears that XCode 6 has changed the path to the simulated app directory and every time you run the app from Xcode, that path changes with a different UDID as part of the folder location. However, even though this behavior is different from previous XCode versions, it seems like macBundlePath() is returning the correct path so I don't see any reason why this shouldn't be working. Argh!
fd9_
Halfling
Posts: 64
Joined: Wed Aug 20, 2008 9:20 pm
x 22

Re: Startup crash on iOs simulator after installing Xcode 6

Post by fd9_ »

I would really appreciate help with this problem as I need to use the iOS simulator for my project.
fd9_
Halfling
Posts: 64
Joined: Wed Aug 20, 2008 9:20 pm
x 22

Re: Startup crash on iOs simulator after installing Xcode 6

Post by fd9_ »

Nobody has an answer?
MrUwd
Gnoblar
Posts: 3
Joined: Wed Nov 12, 2014 5:42 pm

Re: Startup crash on iOs simulator after installing Xcode 6

Post by MrUwd »

Don't suppose you solved this issue?

Since updating to iOS 8.1 my app has stopped working (even the one on the app store). It crashes on launch. Based on Ogre 1.8.

This happens on device and simulator. The crash reports the same error seen above "Cannot create settings file".

Any ideas?
buratino
Gnoblar
Posts: 5
Joined: Fri Nov 14, 2014 9:48 pm

Re: Startup crash on iOs simulator after installing Xcode 6

Post by buratino »

I decided to learn some OGRE, started from iOS 8.1 + OGRE 1.9 + SampleBrowser. But of course OGRE greets me with "Cannot create settings file" error. This is the path it was trying to create:
/private/var/mobile/Containers/Bundle/Application/35A265D0-DEAD-BEEF-7B12-DF0BC4F045F9/SampleBrowser.app/../Documents/ogre.cfg
I'm relatively new to ios and don't know where applications should properly save their files, but next fix works for me.

Replace every occurance of <macBundlePath() + "/../Documents/"> with <iOSDocumentsDirectory() + "/"> like this:

Code: Select all

-    configFileName = macBundlePath() + "/../Documents/" + outBaseName;
+    configFileName = iOSDocumentsDirectory() + "/" + outBaseName;
Recompile the engine and SampleBrowser is now alive on device.

But with simulator8.1 i have this issue:

Code: Select all

...
Registering ResourceManager for type Texture
GLES2RenderSystem::_createRenderWindow "OGRE Sample Browser", 320x568 fullscreen  miscParams: FSAA=0 contentScalingFactor=2 displayFrequency=0 Hz 
dyld: program was built for Mac OS X and cannot be run in simulator
libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: basic_string
Program ended with exit code: 9
Last edited by buratino on Fri Nov 21, 2014 11:58 pm, edited 1 time in total.
buratino
Gnoblar
Posts: 5
Joined: Fri Nov 14, 2014 9:48 pm

Re: Startup crash on iOs simulator after installing Xcode 6

Post by buratino »

Also found the root of the "dyld: program was built for Mac OS X and cannot be run in simulator" issue.
In my case (for GLES2 configuration) it's gles2w.cpp:64. Simulator doesn't allow to run Mac OS X programs, or maybe just some file/group permissions could be fixed?
Anyway i hardcoded the path

Code: Select all

-    std::string xcodePath = exec("/usr/bin/xcode-select -print-path");
+    std::string xcodePath = "/Applications/Xcode.app/Contents/Developer\n";
And now SampleBrowser runs on simulator8.1
Of course i think it's not the proper fix, so i just leave it here for reference.
Post Reply