Search code examples
androidunity-game-enginemonoil2cppsharpkml

Building with il2cpp on Unity doesn't work with the library SharpKml


My app work fine when i build with mono for Android. But when i build with il2cpp, my app work fine too but when i want create a KML file i have a exception: "object reference not set to an instance or a object". Certainly because root must be null.

KmlFile kml = KmlFile.Create(root, false); 
            using (FileStream stream = File.OpenWrite(path))
            {
                kml.Save(stream);
            }

I don't understand why it work with mono but not with il2cpp. il2cpp doesn't include sharpkml in binary app ?


Solution

  • I found. I simply add <assembly fullname="SharpKml.Core" preserve="all"/> and not <assembly fullname="SharpKml" preserve="all"/> and the app work fine.