Unity3D Plugin xxx is used from several locations 错误

错误

1
2
3
4
5
6
7
8
Plugin 'opencvforunity.dll' is used from several locations:
Assets/OpenCVForUnity/Plugins/x86/opencvforunity.dll would be copied to <PluginPath>/opencvforunity.dll
Assets/OpenCVForUnity/Plugins/x86_64/opencvforunity.dll would be copied to <PluginPath>/opencvforunity.dll
Please fix plugin settings and try again.

UnityEditor.Modules.DefaultPluginImporterExtension:CheckFileCollisions(String)
UnityEditorInternal.PluginsHelper:CheckFileCollisions(BuildTarget) (at D:/unity/Editor/Mono/Plugins/PluginsHelper.cs:25)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

原因

我使用的 opencvforunity.dll 库的 32 位版本与 64 位版本在 Unity 编辑器中没有明确指定,所以 Unity 不知道 32 位或者 64 位系统下用哪个 opencvforunity.dll 库。

解决

  • 为 x86 的 opencvforunity.dll 取消 x86_64 平台,只勾选 x86 平台,Apply
  • 为 x86_64 的 opencvforunity.dll 取消 x86 平台,只勾选 x86_64 平台,Apply

Unity3DOpencvforunity.dll