• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by swastiksoni · Apr 07, 2015 at 01:37 AM · androidwindows.netopencvemgucv

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,

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image swastiksoni · Apr 08, 2015 at 07:03 PM 0
Share

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.

avatar image DoTA_KAMIKADzE · Apr 08, 2015 at 07:46 PM 1
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

OpenCV and Android with Unity3D 1 Answer

Face Tracking using openCV is not working accurately 0 Answers

Open With... a Build Unity program 3 Answers

SpeechRecognitionEngine.InstalledRecognizers() returns null within Unity. 3 Answers

Can a windows and an android app use the same assetbundle specified with no target?,Can Windows and Android apps run assetsbundles with notarget? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges