SerializationException: Unable to load layer type on iOS

Hi, what could be causing the following exception, when running an app with Sentis on iOS? The same app runs fine on MacOS.

SerializationException: Unable to load type Unity.Sentis.Layers.Resize required for deserialization.
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] in <00000000000000000000000000000000>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Sentis.ModelLoader.ReadObject[T] (System.IO.Stream stream) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Sentis.ModelLoader.LoadModelDesc (System.IO.Stream stream, Unity.Sentis.Model& model) [0x00000] in <00000000000000000000000000000000>:0
  at Unity.Sentis.ModelLoader.Load (Unity.Sentis.ModelAsset modelAsset) [0x00000] in <00000000000000000000000000000000>:0

We’ve seen it seems to be linked to code stripping.
We’re trying to fix it for a upcoming version

For a quick fix you can look at this thread. Or turn off code stripping in the settings.

Hi @roumenf

Create a xml file with name “link.xml” and keep it in “Assets/” …add below info in it and just build.

<?xml version="1.0" encoding="UTF-8" ?>
<linker>
	<!--Preserve types and members in an assembly-->
	<assembly fullname="Unity.Sentis" preserve="all"/>
	<assembly fullname="Unity.Sentis.ONNX" preserve="all"/>
</linker>

i got same problm of “unable to load layer”.

but i got another problem “B/BL out of range 135336536 from …” when i add

<assembly fullname=“Unity.Sentis” preserve="allassembly fullname=“Unity.Sentis.ONNX” preserve=“all”/>

to link.xml

anyhelp would be appreaciated!