Cross Platform?

Hey All,
I have some code we are porting from a Unity WebPlayer game to iOS in Unity3. In particular I am having issues with our UI system. It runs fine in the editor, stand-alone builds and web player builds but crashes hard on the device. I fear it stems from this message in my GDB output.

position - byteStart != info.byteSize

Is there any black magic I can use besides Debug.Log to figure this out? I submitted a bug, case #374302, on Sept. 16th but have not heard anything about it.

Any help would be greatly appreciated I have already spent 3 days spinning my wheels on this. Below is my GDB log.

[Session started at 2010-09-28 14:11:28 -0700.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1470) (Thu May 27 05:54:06 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys000
Loading program into debugger…
Program loaded.
target remote-mobile /tmp/.XcodeGDBRemote-28253-22
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
2010-09-28 14:12:13.197 Nanovor[73:307] -> registered mono modules
-> applicationDidFinishLaunching()
Mono path[0] = '/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed'
Creating OpenGLES1.x graphics device
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/UnityEngine.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/Assembly-CSharp.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/csharp_light.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/System.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/Mono.Security.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/SmartFoxClient.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/System.Xml.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/SmartFoxClient.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/csharp_light.dll (this message is harmless)
2010-09-28 14:12:16.723 Nanovor[73:6d3b] *** __NSAutoreleaseNoPool(): Object 0x13b6b60 of class NSCFString autoreleased with no pool in place - just leaking
file:///var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/../Build/config.xml
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Got request to load Menus/ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Creating new tracker for Menus/ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Waiting For Menu: ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Got request to load effects/effects_lod00/stun
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Creating new tracker for effects/effects_lod00/stun
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Created Asset Bundle URL: file:///var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/../Build/menus/menus_modaldialog.assetbundle
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Created Asset Bundle URL: file:///var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/../Build/effects/effects_lod00/effects_effects_lod00_stun.assetbundle
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

-> force accelerometer registration
-> applicationDidBecomeActive()
Setting environment to Beta with version 1,2,0,0
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Loading Menu: ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Instantiating Menu: ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

position - byteStart != info.byteSize
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Serialize/SerializedFile.cpp Line: 900)

Initializing Menu: ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

STUIMenu Start() Completed: ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Menu Complete: ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

LoadLevel Start() Completed
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

[Switching to thread 13059]
[Switching to thread 13059]
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) continue
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) continue
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) thread apply all bt

Thread 11 (thread 14595):
#0  0x329ebea0 in __xmlLoadExtDtdDefaultValue ()
#1  0x32981ce8 in xmlInitParserCtxt ()
#2  0x32981e50 in xmlNewParserCtxt ()
#3  0x3299a718 in xmlCreatePushParserCtxt ()
#4  0x32a2ca9c in xmlNewTextReader ()
#5  0x32a2cd08 in xmlReaderForMemory ()
#6  0x36599c38 in CookieFileParser::CookieFileParser ()
#7  0x36599178 in CookieReader::CookieReader ()
#8  0x3658bffc in MemoryCookies::initialize ()
#9  0x364c3544 in DiskCookieStorage::syncStorageLocked ()
#10 0x364c335c in PrivateHTTPCookieStorage::syncStorage ()
#11 0x364c3330 in DiskCookieStorage::_syncTimerFired ()
#12 0x3223525c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#13 0x3223796c in __CFRunLoopDoTimer ()
#14 0x322383f0 in __CFRunLoopRun ()
#15 0x321df0c2 in CFRunLoopRunSpecific ()
#16 0x321defd0 in CFRunLoopRunInMode ()
#17 0x30c7a31c in +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] ()
#18 0x30c4a618 in -[NSThread main] ()
#19 0x30cd0146 in __NSThread__main__ ()
#20 0x311b0f88 in _pthread_start ()
#21 0x311a301c in thread_start ()

Thread 10 (thread 14339):
#0  0x311af68c in __semwait_signal ()
#1  0x3115c3c8 in _pthread_cond_wait ()
#2  0x3115bd70 in pthread_cond_wait ()
#3  0x30c80038 in -[NSCondition wait] ()
#4  0x30c56f38 in -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] ()
#5  0x30c56b90 in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] ()
#6  0x000106f4 in start ()

Thread 9 (thread 14083):
#0  0x311af68c in __semwait_signal ()
#1  0x311288a6 in nanosleep ()
#2  0x00dbea60 in start ()

Thread 8 (thread 13827):
#0  0x311af68c in __semwait_signal ()
#1  0x311288a6 in nanosleep ()
#2  0x3112881e in usleep ()
#3  0x00e5ebe4 in FMOD_File_SetDiskBusy ()
#4  0x00e7e898 in FMOD::SystemI::createChannelGroupInternal ()
#5  0x311b0f88 in _pthread_start ()
#6  0x311a301c in thread_start ()

Thread 7 (thread 13571):
#0  0x31126ab0 in mach_msg_trap ()
#1  0x31128f9c in mach_msg ()
#2  0x32f0f76c in AURemoteIO::IOThread::Entry ()
#3  0x32defa44 in CAPThread::Entry ()
#4  0x311b0f88 in _pthread_start ()
#5  0x311a301c in thread_start ()

Thread 6 (thread 13315):
#0  0x31187afc in sem_wait ()
#1  0x00e5f0f8 in FMOD_File_SetDiskBusy ()
#2  0x00e7e864 in FMOD::SystemI::createChannelGroupInternal ()
#3  0x311b0f88 in _pthread_start ()
#4  0x311a301c in thread_start ()

Thread 5 (thread 12803):
#0  0x31126ab0 in mach_msg_trap ()
#1  0x31128f9c in mach_msg ()
#2  0x32235b1e in __CFRunLoopServiceMachPort ()
#3  0x322380e6 in __CFRunLoopRun ()
#4  0x321df0c2 in CFRunLoopRunSpecific ()
#5  0x321defd0 in CFRunLoopRunInMode ()
#6  0x3043f714 in RunWebThread ()
#7  0x311b0f88 in _pthread_start ()
#8  0x311a301c in thread_start ()

Thread 3 (thread 12291):
#0  0x3115ae84 in kevent ()
#1  0x31228a50 in _dispatch_mgr_invoke ()
#2  0x3122849c in _dispatch_queue_invoke ()
#3  0x3122863c in _dispatch_worker_thread2 ()
#4  0x311b1544 in _pthread_wqthread ()
#5  0x311a8b74 in start_wqthread ()

Thread 2 (thread 13059):
#0  0x0001a218 in start ()

Thread 1 (thread 11523):
#0  0x00d02840 in start ()
kill
quit

you have 3 EXC_BAD_ACCESS
these normally signal that you have null reference exceptions (ie try to access objects that are null)

Yes this appears to be stemming from a failed prefab instantiation.

Here’s what I’ve tried with similar results, minus the EXC_BAD_ACCESS.

  1. WWW an assetbundle and instantiate a prefab out of it.
  2. Resources.Load the prefab and instantiate it.
  3. Put the prefab in the scene.

The object in the prefab is not instantiated on device but all three work fine in editor. I just get position - byteStart != info.byteSize.

2010-09-28 15:09:28.389 Nanovor[151:307] -> registered mono modules
-> applicationDidFinishLaunching()
Mono path[0] = '/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed'
Creating OpenGLES1.x graphics device
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/UnityEngine.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/Assembly-CSharp.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/csharp_light.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/System.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/Mono.Security.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/SmartFoxClient.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/System.Xml.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/SmartFoxClient.dll (this message is harmless)
Non platform assembly: /private/var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/Managed/csharp_light.dll (this message is harmless)
2010-09-28 15:09:31.675 Nanovor[151:6d37] *** __NSAutoreleaseNoPool(): Object 0x13b6dc0 of class NSCFString autoreleased with no pool in place - just leaking
position - byteStart != info.byteSize
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Serialize/SerializedFile.cpp Line: 900)

file:///var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/../Build/config.xml
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

LoadLevel Start() Completed
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Got request to load effects/effects_lod00/stun
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Creating new tracker for effects/effects_lod00/stun
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

Created Asset Bundle URL: file:///var/mobile/Applications/98BF72A0-4CDD-4DA8-9CB2-E3DD4EC662A1/Nanovor.app/Data/../Build/effects/effects_lod00/effects_effects_lod00_stun.assetbundle
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

-> force accelerometer registration
STUIMenu Start() Completed: ModalDialog
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

-> applicationDidBecomeActive()
Setting environment to Beta with version 1,2,0,0
 
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2535)

kill
quit

what I see is that the path to the asset bundle makes totally no sense.
on the desktop, yeah potentially
on the iphone: near granted big nope

I include a reference to a folder of asset bundles in my xCode project. This is not how it will be in production just a crutch to get this project off the ground. I successfully load materials and some particle emitter prefabs from there.

can’t comment on that, but I can say that from the path you use it might not be present at all on the device (path wise). You can use System.IO.File.Exists(…) to check that

It seems to think it is there. I am really worried about this.

position - byteStart != info.byteSize
(Filename: /Applications/buildAgent/work/68355d6e5d19d587/Projects/…/Runtime/Serialize/SerializedFile.cpp Line: 900)

If I remove the script from the GameObject in the prefab I stop getting this error. How could I go about debugging this error? I have tried the Debug.Log tactic and It looks like it is happening between the end construction of the script’s monoBehaviour and the beginning of it’s awake().

how i can load textures from an Xcode folders ( like raw video )? AssetBundles?

i have big out of memory problem with a lot of textures for an iPad project.

thank you

a video is no texture and you can not load it like this (and raw is not a supported texture format - png or jpg should work though)

you can load real textures through WWW for example, accessing the files in the applications data folder and alike.
in case of textures you can additionally use System.File.ReadAllBytes and Texture2Ds LoadImage

thank you Dreamora, i try to explain better.

Is there a way to load textures from Xcode folder and not from a website?
Unity crash with Out of Memory when i try to build after i have added more textures into the project.

I have to install iPad project with ad Hoc distribution with no wifi available.

WWW can load local files, just use the file:// protocol.

but if you are having out of memory on building your project is totally out of scale for an iOS project as you must be overdriving it rather heavily.
A warning when loading from outside: your textures will eat several times the memory they would need if they were in the project

and you can not install anything on devices over anything but USB anyway unless its on the appstore so no prob there :slight_smile:

What is the right path ?
In other words where i can put the textures in Xcode project folders?

sorry, but i’m trying to find documentation without success.

In any case thank you

never experimented with that I fear but it will end with something thats “file://” + application.dataPath + xxxx

i will try it

Thanks