TeamSirenix / odin-serializer

Fast, robust, powerful and extendible .NET serializer built for Unity
http://www.odininspector.com
Apache License 2.0
1.69k stars 193 forks source link

odin Serializer detected non-white-listed runtime platform Android; disabling all unaligned memoryu read/writes. #47

Closed qq21 closed 3 years ago

qq21 commented 3 years ago

how to solve that question it happen when build Android package odin Serializer detected non-white-listed runtime platform Android; disabling all unaligned memoryu read/writes.

TorVestergaard commented 3 years ago

This is a normal message that means everything is working as it should; Odin Serializer is uncertain about the capabilities of the processor it is running on, so it is changing the memory read/write behaviour of its binary format to a slightly slower version which is guaranteed to run on any processor architecture.

Isaiasgamedev commented 2 years ago

How do I change this so that Odin doesn't do this?

TorVestergaard commented 2 years ago

How do I change this so that Odin doesn't do this?

Why would you want the serializer to not do this safety check? It could of course choose not to log the results of the check, but it's often useful to have for debugging purposes when people have errors logs from the serializer at runtime. The check itself has to run; it ensures that Odin is running as it best can without causing any errors on the hardware.

Isaiasgamedev commented 2 years ago

I'm working on a switch version of a game, because it's NDA I can't give more details, but Odin is doing something using File.WriteAllBytes or some System.IO is not allowed by the switch, I'm using the serializer version 3.0.13

Isaiasgamedev commented 2 years ago

this is the log before the dump

Odin Serializer detected non-white-listed runtime platform Switch; disabling all unaligned memory read/writes. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Sirenix.Serialization.ArchitectureInfo:SetRuntimePlatform(RuntimePlatform) Sirenix.Serialization.UnitySerializationInitializer:Initialize() Sirenix.Serialization.UnitySerializationInitializer:InitializeRuntime()

Unloading 6 unused Assets / (2.1 KB). Loaded Objects now: 16697. Memory consumption went from 188.6 MB to 188.6 MB. Total: 41.299375 ms (FindLiveObjects: 2.372604 ms CreateObjectMapping: 1.780573 ms MarkObjects: 36.967500 ms DeleteObjects: 0.177448 ms)

Unloading 2 Unused Serialized files (Serialized files now loaded: 0) Unloading 0 unused Assets / (36.9 KB). Loaded Objects now: 16697. Memory consumption went from 188.6 MB to 188.6 MB. Total: 40.590781 ms (FindLiveObjects: 2.551615 ms CreateObjectMapping: 1.747917 ms MarkObjects: 36.192396 ms DeleteObjects: 0.097656 ms)

Starting main loop at 4.659333 seconds. [LocalFileSystemSwitch::CreateAsDir] Trying to write to 'rom:' mount path 'rom:/Data/%HOMEPATH%'!

Error: nn::fs::CreateDirectory() failed because the operation is unsupported.

TorVestergaard commented 2 years ago

That issue does not look related to what Odin Serializer is doing. All we do is log a message. Then several other unrelated messages are logged, and then your issue occurs.

mottzy commented 1 year ago

I know this is a bit late but I ran into a message like the odin one above. I haven't found THAT solution, but I can say that the Message "[LocalFileSystemSwitch::CreateAsDir] Trying to write to 'rom:' mount path 'rom:/Data/%HOMEPATH%'!" is because you're using "Application.persistentDataPath" which must try to create the persistent directory on the current platform. You have to change how your save paths work using whatever documentation is relevant to the console to manage it.

Hopefully this helps in case anyone else stumbles along here and sees that error. Again, this doesn't help the Odin question (nor am I sure that Odin is causing a problem here, per previous comments).