Hello,
I am currently using SWIG to generate C++ bindings to C# for the development of a Unity plugin for SolAR Framework. When I am using C# wrapped in Unity editor or on standalone it is working perfectly. However, while using Unity for mobile development (Android) with IL2CPP compiler its throw an exception :
ADB output

This is due to IL2CPP that throws exceptions. It detects that there is not callback emitted ahead and as a consequences it is trying to marshal a function pointer from unmanaged code (Unity ScriptingRestrictions). The error suggest to add MonoPInvokeCallback to manage it and it works. I have found more details thanks to the issue #1165 and many posts on the web.
How is it possible to directly add MonopInvoke annotation in SWIG rules for SWIG Helper static method ? I tried typemap, manage exception but it only works with my declared method.
As a temp hack, we use for the moment a script to parse all *PINVOKE.cs generated to add MonoPInvokeCallback annotation to the static's method of SWIGHelper and it works on Android.
Thanks for your help.
Hello,
I am currently using SWIG to generate C++ bindings to C# for the development of a Unity plugin for SolAR Framework. When I am using C# wrapped in Unity editor or on standalone it is working perfectly. However, while using Unity for mobile development (Android) with IL2CPP compiler its throw an exception :
ADB output

This is due to IL2CPP that throws exceptions. It detects that there is not callback emitted ahead and as a consequences it is trying to marshal a function pointer from unmanaged code (Unity ScriptingRestrictions). The error suggest to add MonoPInvokeCallback to manage it and it works. I have found more details thanks to the issue #1165 and many posts on the web.
How is it possible to directly add MonopInvoke annotation in SWIG rules for SWIG Helper static method ? I tried typemap, manage exception but it only works with my declared method.
As a temp hack, we use for the moment a script to parse all *PINVOKE.cs generated to add MonoPInvokeCallback annotation to the static's method of SWIGHelper and it works on Android.
Thanks for your help.