Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Error building for windows store

Discussion in 'Windows' started by Tomer-Barkan, Nov 4, 2014.

  1. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    Hi,

    When trying to build for windows store, I create the visual studio project in Unity, follow the instructions here, and when I try to build using F5, I get the following error:

    Code (CSharp):
    1. Error    1    The command "echo UnityInstallationDir 'C:\Program Files (x86)\Unity\Editor'
    2. echo UnityProjectDir 'C:\Users\Tomer\Documents\Unity Projects\bball_unity'
    3. echo Copying assemblies...
    4. copy /Y "C:\Users\Tomer\Documents\Unity Projects\bball_unity\Export\win8\Tabletop Basketball\Unprocessed\*" "C:\Users\Tomer\Documents\Unity Projects\bball_unity\Export\win8\Tabletop Basketball\"
    5. echo Running AssemblyConverter...
    6. "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\MetroSupport\Tools\AssemblyConverter.exe" -platform=wsa81 "C:\Users\Tomer\Documents\Unity Projects\bball_unity\Export\win8\Tabletop Basketball\\Assembly-CSharp.dll" "C:\Users\Tomer\Documents\Unity Projects\bball_unity\Export\win8\Tabletop Basketball\\UnityEngine.dll" "C:\Users\Tomer\Documents\Unity Projects\bball_unity\Export\win8\Tabletop Basketball\\WinRTLegacy.dll"
    7. echo AssemblyConverter done.
    8. " exited with code 1.    Tabletop Basketball
    9.  
    In the output log I see:
    Code (CSharp):
    1. 1>  Running AssemblyConverter...
    2. 1>  System.IO.FileNotFoundException: Assembly "Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" file not found.
    3. 1>     at Unity.PlatformAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
    4. 1>     at Unity.PlatformAssemblyResolver.Resolve(AssemblyNameReference name)
    5. 1>     at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
    6. 1>     at Mono.Cecil.TypeReference.Resolve()
    7. 1>     at Unity.AssemblyWrapper.AddType(TypeReference type)
    8. 1>     at Unity.MetadataContainer.AddType(TypeReference type)
    9. 1>     at Unity.AssemblyWrapper.GetCallableMethods(TypeWrapper typeWrapper, TypeDefinition type, Boolean publicOnly)
    10. 1>     at Unity.AssemblyWrapper.AddType(TypeReference type)
    11. 1>     at Unity.MetadataContainer.AddType(TypeReference type)
    12. 1>     at Unity.GetTypesStep.Visit(TypeDefinition type)
    13. 1>     at Unity.TypeDefinitionDispatcher.DispatchType(TypeDefinition type)
    14. 1>     at Unity.TypeDefinitionDispatcher..ctor(ModuleDefinition module, ITypeDefinitionVisitor visitor)
    15. 1>     at Unity.GetTypesStep.ProcessModule()
    16. 1>     at Unity.ModuleStep.Execute()
    17. 1>     at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
    18. 1>     at Unity.Operation.Execute()
    19. 1>     at Unity.Program.Main(String[] args)
    20. 1>  AssemblyConverter done.
    21.  
    Any ideas?
    I checked and the file Assembly-CSharp-firstpass.dll is indeed in the directory that unity created.
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Which Unity version is this?
     
  3. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    It happened in Unity 4.5.3, and I just upgraded to 4.5.5, same result.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,627
    Do you see Assembly-CSharp-firstpass.dll inside Unprocessed folder?
    Or are you using C# projects?
     
  5. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    I'm using C# projects. I see it in both the unprocessed and root directory.
    I did manage to narrow down the problem a bit. I'm using Unity Analytics, and although I encased all the code in
    Code (CSharp):
    1. if #UNITY_METRO
    I still get these errors.

    I found out that deleting a dll that was part of that plugin does solve the problem, but now I don't have that dll in non-metro builds either.

    I also noticed that with the dll present, although the export succeeds, I'm getting a bunch of errors like this when exporting:
    Code (CSharp):
    1. Reference Rewriter: Error: field `System.Char System.IO.Path::DirectorySeparatorChar` doesn't exist in target framework. It is referenced from UnityEngine.Cloud.Analytics.dll at System.Void UnityEngine.Cloud.Analytics.SessionImpl::.cctor().
    2.  
    3. UnityEngine.Debug:LogError(Object)
    4. PostProcessMetroPlayer:RunReferenceRewriter(MetroSDK, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:489)
    5. PostProcessMetroPlayer:PostProcessSDKSpecific(MetroSDK, BuildTarget, BuildOptions, String, String, ProjectImages) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:1007)
    6. PostProcessMetroPlayer:PostProcess(BuildTarget, BuildOptions, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:740)
    7. UnityEditor.HostView:OnGUI()
    8.  
    Any help would be appreciated so I don't have to delete the dll every time I build for windows and re-add it when building for other platforms.
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Just a guess, but you could try to fool Unity, simply create an empty file, name it UnityEngine.Cloud.Analytics.dll and place it to Assets\Plugins\Metro. Didn't try this myself, but it's worth a shot
     
  7. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    I'll give it a try, but just to be clear on what unity does when building to windows store:

    If I have a plugin in Plugins\Metro, it would take that instead of the one in Plugins? And if I don't, then it uses the one in Plugins? (assuming both plugins have the same name)
     
  8. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    That's correct
     
  9. Tomer-Barkan

    Tomer-Barkan

    Joined:
    Jul 31, 2012
    Posts:
    150
    An empty DLL seemed to do the trick.

    Thanks!