Quantcast
Channel: Questions in topic: "dllimport"
Viewing all articles
Browse latest Browse all 160

Catching DLLImport errors

$
0
0
Hello, I have a Android and a IOS C# wrapper I use to import my native libraries. I have set them up according to the plugin guides and it works fine. However, due to the nature of unity I have to reference them both when I build, since I cannot load them at runtime with Reflection on android/IOS unless I manually copy them every time I build and thats not good. This means the C# wrapper for iOS also gets included in Android and vice versa, but I use Application.RuntimePlatform to determine which C# wrapper to use. So it works. The problem is the declaration in the C# wrappers have to look like this: [DllImport("__Internal")] internal static extern void IOS_TestMe(); And if I build on Android, it will throw errors in my log for each and every DllImport used in the iOS wrapper. Is there any way to suppress these errors? I can't use try/catch since its in the class declaration.

Viewing all articles
Browse latest Browse all 160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>