Search Unity

[WP8] UnityPlayer.winmd and Unity 5

Discussion in 'Windows' started by zoooom, Mar 30, 2015.

  1. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    41
    Hi there,

    I'm upgrading a WP8 project from Unity 4.6 to Unity 5, and am getting some errors with a native plugin that I've written. I have changed the import settings on the two dll files to the correct platform setup and changed the placeholder path on the real dll, but am getting:

    ArgumentException: The Assembly UnityPlayer is referenced by MyPlugin ('Assets/Plugins/WP8/MyPlugin.dll'). But the dll is not allowed to be included or could not be found.

    Anyone got any ideas? I need to use UnityPlayer.UnityApp.BeginInvoke so can't just remove that section of code.

    Cheers!
     
    Last edited: Mar 30, 2015
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    2,246
    How are you plugin files placed in directory tree and what are the settings for them?
    Possibly you have something set up incorrectly, but I can't tell without these details.
     
  3. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    41
    Hi there, thanks for your reply, my setup looks like this:

    Assets/Plugins/MyPlugin.pdb
    Assets/Plugins/MyPlugin.dll (platforms: all except WP8Player, CPU: Any CPU, OS: Any OS)

    Assets/Plugins/WP8/MyPlugin.pdb
    Assets/Plugins/WP8/MyPlugin.dll (platforms: WP8Player only, CPU: Any CPU, Don't process: Unchecked, Placeholder: Assets/Plugins/MyPlugin.dll)
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    2,246
    OK, now I'm a bit confused. You said it's native plugin in your first message, but your setup looks like it's managed dll. Is it .NET dll?
    Also, where does the error come from? Can paste full error from Editor?
     
  5. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    41
    http://docs.unity3d.com/Manual/wp8-plugins-guide-csharp.html

    created using that method and it all worked great on Unity 4.6. Full error log is:

    ArgumentException: The Assembly UnityPlayer is referenced by MyPlugin ('Assets/Plugins/WP8/MyPlugin.dll'). But the dll is not allowed to be included or could not be found.
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:160)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:166)
    UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:198)
    UnityEditor.HostView:OnGUI()
     
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    2,246
    I think the error is still incomplete, there should be something in beginning...

    One thing you can do is to redesign your plugin to not referaence UnityPlayer, but rather to declare delegates and set them from main application, where you have access to UnityPlayer.
     
  7. zoooom

    zoooom

    Joined:
    Feb 8, 2012
    Posts:
    41
    When I try to build I get that previously mentioned error, and another one that simply says:

    Error building Player: Extracting referenced dlls failed.

    And that is everything! No other warnings or errors anywhere. Strangely enough if I drop UnityPlayer.winmd into my Assets/Plugins folder, it gets much further into the build but then comes up with a Duplicate Library error. So it's like there's something going wrong in the compilation order.

    I can go the delegate route but was just hoping there was a simple explanation without having to recode everything.

    Thanks for your help :)