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

318 Views Asked by At

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 ?

1

There are 1 best solutions below

0
Cyrille Mouret On BEST ANSWER

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