Building project for Nintendo Switch on Unity

724 views Asked by At

While I try build my project on Unity for Nintendo Switch I get Error in il2cpp and Exeptions:

Error 1:

Failed running E:\Program Files\Unity 2020.1.0b8\Editor\Data\il2cpp/build/deploy/netcoreapp3.0/il2cpp.exe --convert-to-cpp --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --platform="Switch" --architecture="ARM64" --configuration="Release" --outputpath="C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Native\SwitchPlayer.nss" --cachedirectory="C:/Program Files/Unity/OwnGames/1111/Assets/../SwitchIL2CPPCache/il2cpp_cache" --linker-flags="-nC:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Application.aarch64.lp64.nmeta" --plugin="E:/Program Files/Unity 2020.1.0b8/Editor/Data/PlaybackEngines/Switch/Tools\Il2CppPlugin.dll" --additional-include-directories="E:\Program Files\Unity 2020.1.0b8\Editor\Data\PlaybackEngines\Switch\Tools/il2cpp\bdwgc/include" --additional-include-directories="E:\Program Files\Unity 2020.1.0b8\Editor\Data\PlaybackEngines\Switch\Tools/il2cpp\libil2cpp/include" --baselib-directory="E:\Program Files\Unity 2020.1.0b8\Editor\Data\PlaybackEngines\Switch\Native\release" --avoid-dynamic-library-copy --verbose --enable-stats --stats-output-dir="C:/Program Files/Unity/OwnGames/1111/Assets/../SwitchIL2CPPStats" --libil2cpp-static --additional-defines="DEBUGMODE=0,UNITY_RELEASE=1,IL2CPP_USE_SOCKET_MULTIPLEX_IO=1" --configuration="ReleasePlus" --incremental-g-c-time-slice=3 --profiler-report --map-file-parser="E:/Program Files/Unity 2020.1.0b8/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory="C:/Program Files/Unity/OwnGames/1111/Temp/StagingArea/Managed" --generatedcppdir="C:/Program Files/Unity/OwnGames/1111/Temp/StagingArea/il2cppOutput" 

stdout:
Running il2cpp.exe in server GC mode.
Building SwitchPlayer.nss with SwitchToolChain
    Output directory: C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Native
    Cache directory: C:\Program Files\Unity\OwnGames\1111\SwitchIL2CPPCache\il2cpp_cache
ObjectFiles: 181 of which compiled: 36
    Time Compile: 2527 milliseconds SocketImpl.cpp
    Time Compile: 2266 milliseconds Directory.cpp
    Time Compile: 2169 milliseconds LibraryLoader.cpp
    Time Compile: 1940 milliseconds Cryptography.cpp
    Time Compile: 1746 milliseconds MultiplexIO.cpp
    Time Compile: 1680 milliseconds Environment.cpp
    Time Compile: 1628 milliseconds File.cpp
    Time Compile: 1376 milliseconds SwitchFileUtilities.cpp
    Time Compile: 1095 milliseconds DirectoryUtils.cpp
    Time Compile: 1086 milliseconds Locale.cpp
Total compilation time: 2732 milliseconds.
C:\Users\sinek\Downloads\Switch\NSDK+NWv9.2.0FIXED\NintendoSDK\Tools\CommandLineTools\MakeNso\MakeNso.exe "C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Native\SwitchPlayer.nss" "C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\SwitchPlayer.nspd\program0.ncd\code\main" returned true
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Users\sinek\Downloads\Switch\NSDK+NWv9.2.0FIXED\NintendoSDK\Tools\CommandLineTools\MakeMeta\MakeMeta.exe  --desc C:\Users\sinek\Downloads\Switch\NSDK+NWv9.2.0FIXED\NintendoSDK\Resources\SpecFiles\Application.desc --meta "C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Application.aarch64.lp64.nmeta" -o "C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\SwitchPlayer.nspd\program0.ncd\code\main.npdm" failed:

Input Desc File: 'C:\Users\sinek\Downloads\Switch\NSDK+NWv9.2.0FIXED\NintendoSDK\Resources\SpecFiles\Application.desc'
Input Meta File: 'C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Application.aarch64.lp64.nmeta'
System.InvalidOperationException: There is an error in XML document (894, 3). ---> System.ArgumentException: Either an undefined element is in use or the definition of an element already exists. :Signature
   at MakeMeta.Program.serializer_UnknownElement(Object sender, XmlElementEventArgs e)
   at System.Xml.Serialization.XmlSerializationReader.UnknownElement(Object o, XmlElement elem, String qnames)
   at System.Xml.Serialization.XmlSerializationReader.UnknownNode(XmlNode unknownNode, Object o, String qnames)
   at System.Xml.Serialization.XmlSerializationReader.UnknownNode(Object o, String qnames)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOutputDescModel.Read19_OutputDescModel(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOutputDescModel.Read20_Desc()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
   at MakeMeta.Program.Main(String[] args)

   at Unity.IL2CPP.Building.ToolChains.Switch.SwitchToolChain.RunCommand(String command, String arguments) in C:\buildslave\unity\build\PlatformDependent\Switch\Tools\Il2Cpp\plugin\SwitchToolChain.cs:line 589
   at Unity.IL2CPP.Building.ToolChains.Switch.SwitchToolChain.FinalizeBuild(ProgramBuildDescription programBuildDescription) in C:\buildslave\unity\build\PlatformDependent\Switch\Tools\Il2Cpp\plugin\SwitchToolChain.cs:line 563
   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions)
   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions)
   at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
   at il2cpp.Program.Main(String[] args)
stderr:
Unhandled exception. Unity.IL2CPP.Building.BuilderFailedException: C:\Users\sinek\Downloads\Switch\NSDK+NWv9.2.0FIXED\NintendoSDK\Tools\CommandLineTools\MakeMeta\MakeMeta.exe  --desc C:\Users\sinek\Downloads\Switch\NSDK+NWv9.2.0FIXED\NintendoSDK\Resources\SpecFiles\Application.desc --meta "C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Application.aarch64.lp64.nmeta" -o "C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\SwitchPlayer.nspd\program0.ncd\code\main.npdm" failed:

Input Desc File: 'C:\Users\sinek\Downloads\Switch\NSDK+NWv9.2.0FIXED\NintendoSDK\Resources\SpecFiles\Application.desc'
Input Meta File: 'C:\Program Files\Unity\OwnGames\1111\Temp\StagingArea\Application.aarch64.lp64.nmeta'
System.InvalidOperationException: There is an error in XML document (894, 3). ---> System.ArgumentException: Either an undefined element is in use or the definition of an element already exists. :Signature
   at MakeMeta.Program.serializer_UnknownElement(Object sender, XmlElementEventArgs e)
   at System.Xml.Serialization.XmlSerializationReader.UnknownElement(Object o, XmlElement elem, String qnames)
   at System.Xml.Serialization.XmlSerializationReader.UnknownNode(XmlNode unknownNode, Object o, String qnames)
   at System.Xml.Serialization.XmlSerializationReader.UnknownNode(Object o, String qnames)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOutputDescModel.Read19_OutputDescModel(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderOutputDescModel.Read20_Desc()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
   at MakeMeta.Program.Main(String[] args)

   at Unity.IL2CPP.Building.ToolChains.Switch.SwitchToolChain.RunCommand(String command, String arguments) in C:\buildslave\unity\build\PlatformDependent\Switch\Tools\Il2Cpp\plugin\SwitchToolChain.cs:line 589
   at Unity.IL2CPP.Building.ToolChains.Switch.SwitchToolChain.FinalizeBuild(ProgramBuildDescription programBuildDescription) in C:\buildslave\unity\build\PlatformDependent\Switch\Tools\Il2Cpp\plugin\SwitchToolChain.cs:line 563
   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions)
   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions)
   at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
   at il2cpp.Program.Main(String[] args)

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase)
UnityEditorInternal.Runner:RunNetCoreProgram(String, String, String, CompilerOutputParserBase, Action`1)
UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean)
UnityEditorInternal.IL2CPPBuilder:Run()
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Error 2:

E:\Program Files\Unity 2020.1.0b8\Editor\Data\il2cpp/build/deploy/netcoreapp3.0/il2cpp.exe did not run properly!
  at UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) [0x0012b] in <96ac283d3ed54c8586075d55d7cc2a57>:0 
  at UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) [0x0005d] in <96ac283d3ed54c8586075d55d7cc2a57>:0 
  at UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) [0x0007a] in <96ac283d3ed54c8586075d55d7cc2a57>:0 
  at UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) [0x0031a] in <96ac283d3ed54c8586075d55d7cc2a57>:0 
  at UnityEditorInternal.IL2CPPBuilder.Run () [0x000de] in <96ac283d3ed54c8586075d55d7cc2a57>:0 
  at UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) [0x0001c] in <96ac283d3ed54c8586075d55d7cc2a57>:0 
  at UnityEditor.Switch.PostProcessSwitch.PostProcess (UnityEditor.BuildTarget target, UnityEditor.BuildOptions options, System.String installPath, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String stagingAreaDataManaged, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) [0x00458] in C:\buildslave\unity\build\PlatformDependent\Switch\Editor\Managed\PostProcessSwitch.cs:237 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Exeption:

Exception: E:\Program Files\Unity 2020.1.0b8\Editor\Data\il2cpp/build/deploy/netcoreapp3.0/il2cpp.exe did not run properly!
UnityEditor.Switch.PostProcessSwitch.PostProcess (UnityEditor.BuildTarget target, UnityEditor.BuildOptions options, System.String installPath, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String stagingAreaDataManaged, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/PlatformDependent/Switch/Editor/Managed/PostProcessSwitch.cs:626)
UnityEditor.Switch.SwitchBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/Switch/Editor/Managed/ExtensionModule.cs:492)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <96ac283d3ed54c8586075d55d7cc2a57>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <96ac283d3ed54c8586075d55d7cc2a57>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I tried reinstall SDK, used other versions Unity, used other version Nintendo SDK, but it didn't solved this problem. Has anyone else encountered such a problem? If so, how did you solve it?

Thank you in advance ♡

0

There are 0 answers