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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

A* Pathfinding: "Failed to run serialization weaver" when building for Windows Store (WP8.1)

Discussion in 'Windows' started by IDoAllTheWork, Jan 5, 2016.

  1. IDoAllTheWork

    IDoAllTheWork

    Joined:
    Jun 20, 2015
    Posts:
    19
    I just recently tried the free version of A* Pathfinding, and everytime I try to build for Windows Store, the error pasted below occurs. Build for Android however works fine, so it has to be something platform specific. Has anyone else run into this error before? I couldn't find any answers.

    PS: I'm using Unity 5.3.0 and A* Pathfinding 3.7.4.

    PPS: Ok, I found it out myself (or at least partly ;-) ), and in case you're a noob like I am here's the solution: Add a #define ASTAR_NO_JSON and #define ASTAR_NO_ZIP in all the files that contain a respective #if and deactivate AstarPathfindingProject/Plugins/DotNetZip/Pathfinding.Ionic.Zip.Reduced.dll and AstarPathfindingProject/Plugins/JsonFx/Pathfinding.JsonFx.dll for Windows Store Apps (select the files in the Unity Editor and activate every platform except "WSAPlayer").
    Link


    UnityException: Failed to run serialization weaver with command "Temp\StagingArea\Data\Managed\Pathfinding.JsonFx.dll" -pdb -verbose -unity-engine="Temp\StagingArea\Data\Managed\UnityEngine.dll" "Temp\StagingArea\TempSerializationWeaver" -additionalAssemblyPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhoneApp\v8.1".
    Symbols will be read from Temp\StagingArea\Data\Managed\UnityEngine.pdb
    Weaving assembly D:\Dokumente\Unity\TacTeam\TacTeam\Temp\StagingArea\Data\Managed\Pathfinding.JsonFx.dll
    No symbols for Temp\StagingArea\Data\Managed\Pathfinding.JsonFx.dll
    Will export symbols of pdb format
    Mono.Cecil.ResolutionException: Failed to resolve System.Reflection.BindingFlags
    bei Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
    bei Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
    bei Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
    bei Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
    bei Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)
    bei Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
    bei Mono.Cecil.MetadataBuilder.AddTypeDefs()
    bei Mono.Cecil.MetadataBuilder.BuildTypes()
    bei Mono.Cecil.MetadataBuilder.BuildModule()
    bei Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, MetadataReader _)
    bei Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
    bei Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
    bei Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
    bei usw.Weaver.WeaveAssembly(String assemblyPath, AssemblyDefinition unityEngineAssemblyDefinition)
    bei usw.Weaver.Weave()
    bei usw.Program.RunProgram(ConversionOptions options)
    bei usw.Program.Main(String[] args)

    PostProcessWinRT.RunSerializationWeaver () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:434)
    PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:120)
    UnityEditor.Metro.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:133)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
     
    Last edited: Jan 6, 2016
  2. IDoAllTheWork

    IDoAllTheWork

    Joined:
    Jun 20, 2015
    Posts:
    19
    Maybe I found the solution: I need to enable ASTAR_NO_JSON and ASTAR_NO_ZIP, then delete the AstarPathfindingProject/Plugins/DotNetZip/Pathfinding.Ionic.Zip.Reduced.dll and AstarPathfindingProject/Plugins/JsonFx/Pathfinding.JsonFx.dll. But I don't know where to enable ASTAR_NO_JSON and ASTAR_NO_ZIP yet...

    Link
     
  3. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,642
    Can you paste the exact error?

    I don't know about the plugin in question. Does it contain MonoBehaviour derivatives or anything serializable? If not, you can mark it unprocessed and it would solve that error.
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,673
    It fails to find "Failed to resolve System.Reflection.BindingFlags", probably that assembly is compiled against incorrect .NET. And yes, the steps you specified might help you overcome this issue.
     
  5. IDoAllTheWork

    IDoAllTheWork

    Joined:
    Jun 20, 2015
    Posts:
    19
    Ok, I managed to fix it and in case there are more noobs like me, I added the solution to the OP.
    And thanks for your replies guys :)