Exception while loading SdkTrays.zip

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
daedalic
Gnoblar
Posts: 24
Joined: Wed May 02, 2012 7:19 pm

Exception while loading SdkTrays.zip

Post by daedalic » Sat May 19, 2012 4:38 am

I'm getting an exception thrown during the call to Ogre::ResourceGroupManager::getSingleton().addResourceLocation().
The arguments being passed into the call are "/Users/daedalic/Library/Application Support/iPhone Simulator/5.1/Applications/98EAEF81-FAE8-48FA-8F31-585FDA3BD84C/3DPong iPhone Sim Debug.app/media/packs/SdkTrays.zip", "Zip", and "Bootstrap".

The exception description is "OGRE EXCEPTION(7:InternalErrorException): /Users/daedalic/Library/Application Support/iPhone Simulator/5.1/Applications/98EAEF81-FAE8-48FA-8F31-585FDA3BD84C/3DPong iPhone Sim Debug.app/media/packs/SdkTrays.zip - error whilst opening archive: Unable to read zip file. in ZipArchive::checkZzipError at /Users/daedalic/Development/ogre_src_v1-8/OgreMain/src/OgreZip/cpp (line 297)."

The loading of this zip file works fine in the ogre iOS template app and the settings with regard to the resources.cfg and the location of the media directory are the same.

The line in the resources.cfg file is Zip=media/packs/SdkTrays.zip

The media directory is in the same location as the app code and the SdkTrays.zip file is in the right place.

Any idea on what would be causing this problem? Any help is much appreciated!
0 x

daedalic
Gnoblar
Posts: 24
Joined: Wed May 02, 2012 7:19 pm

Re: Exception while loading SdkTrays.zip

Post by daedalic » Mon May 21, 2012 8:27 pm

I got around this problem by specifying absolute file paths for everything in resources.cfg, like so:

Code: Select all

Zip=/Users/daedalic/Development/IOS/3DPong/3DPong/media/packs/SdkTrays.zip
When I use a relative path, this code sets up the absolute path:

Code: Select all

if (!Ogre::StringUtil::startsWith(archName, "/", false)) // only adjust relative dirs
                archName = Ogre::String(Ogre::macBundlePath() + "/" + archName);
I'd still prefer to use relative file paths, so any solution to this would be helpful.
0 x

magengyu
Kobold
Posts: 35
Joined: Sat Jul 28, 2012 7:54 am

Re: Exception while loading SdkTrays.zip

Post by magengyu » Fri Aug 10, 2012 2:40 am

I think your problem is similar with mine.
http://www.ogre3d.org/forums/viewtopic.php?f=21&t=71174

however, I think setting absolute directory only work for simulator. In fact, the .zip files are in the app's root directory.

you can set cfg as:

Code: Select all

Zip=SdkTrays.zip
0 x

Ologon
Halfling
Posts: 70
Joined: Sun Dec 02, 2007 11:10 am
Location: Italy

Re: Exception while loading SdkTrays.zip

Post by Ologon » Fri Aug 10, 2012 10:03 am

I'm pretty sure OSX and iOS don't set the working directory for your app, so your latter approach is correct. (And it's used in the sample template as well)
It works both on the simulator and the iphone for me.

However you should not set absolute paths in the resources.cfg as these are variable. Also make sure you readd the "media" folder to your project cheking "Create folder references for any added folders" and "Copy items" as well.
This solved some file related errors i had with the sample template.
0 x

Gf11speed
Goblin
Posts: 242
Joined: Sat Mar 20, 2004 7:53 am
Location: Orlando, FL
Contact:

Re: Exception while loading SdkTrays.zip

Post by Gf11speed » Fri Jun 14, 2013 3:21 am

I'm seeing this same issue. It was working fine until I manually built the Ogre source and copied over the built OgreMain_d.dll file into my runtime directory. Then I started getting this error. Why would the DLL matter in determining the path location? It works if I use my old DLL.

After digging further into it, I am somehow getting a ERROR_ACCESS_DENIED when trying to read the file in ReadFile(). Odd, because this isn't an Ogre or zzip package. It's msvcr. No idea why I would be able to open the file but get access denied when reading from it. I tried setting my permissions for that file as well as running the Ogre exe as administrator.
0 x
Coming soon...

Gf11speed
Goblin
Posts: 242
Joined: Sat Mar 20, 2004 7:53 am
Location: Orlando, FL
Contact:

Re: Exception while loading SdkTrays.zip

Post by Gf11speed » Wed Jun 19, 2013 6:51 am

Found the solution to this problem. Check here: http://www.ogre3d.org/addonforums/viewt ... f=2&t=1105

Basically building the Ogre dlls and not building the Dependencies to go along with it. Dlls mismatch.
0 x
Coming soon...

Post Reply