- Home /
EMGUCV with Unity : System.Windows.Forms.dll assembly is referenced by user code, but is not supported on Android platform.
Hi guys,
I have integrated emgucv with unity to make some body detection app. My program is working fine in editor but I am not able to build standalone or android application properly. I am getting this warning "System.Windows.Forms.dll assembly is referenced by user code, but is not supported on Android platform. Various failures might follow. UnityEditor.HostView:OnGUI()" whenever I am trying to build android or standalone app.
Any suggestion is greatly appreciated. thanks,
Answer by DoTA_KAMIKADzE · Apr 08, 2015 at 05:24 PM
You should use Platform Dependent Compilation in your coding when you use platform dependent libraries (Android can't use Windows Forms), do it like this:
#if UNITY_ANDROID
//your android version of some code
#elif UNITY_STANDALONE_WIN
//your windows version of some code
#endif
Same goes for namespace using.
Hi there, I have tried it but I am still getting the same warning message. I have not used windows form anywhere in my code. It gives me this warning "System.Windows.Forms.dll assembly is referenced by user code, but is not supported on StandaloneWindows platform. Various failures might follow. UnityEditor.HostView:OnGUI()" when I build for windows standalone also.
I might not doing the the platform dependent compilation for namespace using correctly. can u please give me an example of that.
And you don't need to - some functions/dlls of E$$anonymous$$GUCV do.
You should download E$$anonymous$$GUCV source code and either compile features you need for Windows and then for Android or you could just add E$$anonymous$$GUCV c# codes in Unity's assets folder if the license allows you to do so and replace .net preprocessor statements (#if...) with the ones I have shown you in the answer.
In any case not a single person over here will help you with this because it's a ton of work, so if you don't understand how to do one of the above^ your best bet would be to contact someone from E$$anonymous$$GUCV crew and ask them to compile it for you for both Windows and Android build without "Winform and WPF"-specific features and for .net2.
P.S. You can also just omit dlls that use Winform and WPF features if they throw that in a separate dlls.
Your answer
Follow this Question
Related Questions
OpenCV and Android with Unity3D 1 Answer
EmguCV CalibrateCamera - EntryPointNotFoundException 1 Answer
Unity analytics not working for android or windows builds 0 Answers
my andriod is not connecting to the unity editor 0 Answers
unity is not creating build on .NET 2.0 SUBNET and getting ArgumentException. 1 Answer