Search Unity

Coding inside IL2CPP project

Discussion in 'Windows' started by elettrozero, Apr 15, 2017.

  1. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    I'm trying to add Xbox Live calls inside the project.

    In Unity project I call the method public static void SilentSignIn () from the Start method in a MonoBehaviour.
    That method is converted in

    Code (CSharp):
    1. extern "C"  void XboxLiveManager_SilentSignIn_m576691742 (Il2CppObject * __this /* static, unused */, const MethodInfo* method)
    which is in Il2CppOutputProject

    Inside such method I must call Windows::System::User::FindAllAsync but : even if I import Windows.h I cannot resolve Windows namespace.

    Please help.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Generally, you shouldn't edit generated C++ code, because it will get overwritten every time you build from Unity. Generally, if you want to call into C++ code, you'd use "P/Invoke" functions in C# and then have your implementations ready as lose .cpp files in your Unity project or as .dll files (already compiled C++ code).

    However, are you on Unity 5.6? You can call these methods directly from C# in your scripts. No need to write anything in C++:

    https://docs.unity3d.com/Manual/IL2CPP-WindowsRuntimeSupport.html
     
  3. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    Thirst: thank you for replying.
    Second: I switched the player to Windows Store platform and set parameters as indicated in documentation:
    API Compatibility Level: .NET 4.6
    Compilation Overrides: Use Net Core

    Am I supposed, this way, to be able to use Windows namespace inside scripts? Because it doesn't work....
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Yeah you should be. Just don't forget to wrap that code inside #if ENABLE_WINMD_SUPPORT/#endif. For instance:

    Code (csharp):
    1.  
    2. #if NET_4_6
    3. async
    4. #endif
    5. void SilentSignIn()
    6. {
    7.     #if ENABLE_WINMD_SUPPORT
    8.     var users = await Windows.System.User.FindAllAsync();
    9.     foreach (var user in users)
    10.         ...
    11.     #endif
    12. }
     
  5. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216


    I'm making several tests because I'm pretty sure I'm not setting up something right.
    One of the error is, the script does not compile because it doesn't recognize the modifier async. Also, is it expected to show all that code in gray?
     
  6. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    Wait, something moved....

    Once I thrown in Xbox Live DLL and a custom test DLL


    The solution duplicated the project this way



    The .Player project references what I need and the code assist goes my way. I think I should find a way now to separate the code between the two project with an #if ...
     
  7. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    Trying to build the IL2CPP project here's what I got:

    Error MSB3073 The command ""D:\TestXboxLive\Builds\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x64 -configuration=Debug -platform=winrt -outputpath="D:\TestXboxLive\Builds\\build\bin\x64\Debug\GameAssembly.dll" --data-folder="D:\TestXboxLive\Builds\\build\bin\x64\Debug\\" -cachedirectory="D:\TestXboxLive\Builds\\build\obj\il2cppOutputProject\x64\Debug\\" -generatedcppdir="D:\TestXboxLive\Builds\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT -dotnetprofile=Net45 -verbose --map-file-parser="D:\TestXboxLive\Builds\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766. Il2CppOutputProject C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 44



    Full log:

    1>------ Build started: Project: Il2CppOutputProject, Configuration: Debug x64 ------
    1>Building GameAssembly.dll with MsvcWinRtToolChain.
    1> Output directory: D:\TestXboxLive\Builds\build\bin\x64\Debug
    1> Cache directory: D:\TestXboxLive\Builds\build\obj\il2cppOutputProject\x64\Debug
    1>il2cpp.exe didn't catch exception: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)
    1> --- End of inner exception stack trace ---
    1> at Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[] data, Func`2 action)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    1> at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner(CppProgramBuilder builder, IBuildStatistics& statistics)
    1> at il2cpp.Program.DoRun(String[] args)
    1> at il2cpp.Program.Run(String[] args)
    1> at il2cpp.Program.Main(String[] args)
    1>---> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (Inner Exception #1) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (Inner Exception #2) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (Inner Exception #3) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (Inner Exception #4) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (Inner Exception #5) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (Inner Exception #6) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (Inner Exception #7) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>
    1>Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)
    1> --- End of inner exception stack trace ---
    1> at Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[] data, Func`2 action)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    1> at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner(CppProgramBuilder builder, IBuildStatistics& statistics)
    1> at il2cpp.Program.DoRun(String[] args)
    1> at il2cpp.Program.Run(String[] args)
    1> at il2cpp.Program.Main(String[] args)
    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""D:\TestXboxLive\Builds\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x64 -configuration=Debug -platform=winrt -outputpath="D:\TestXboxLive\Builds\\build\bin\x64\Debug\GameAssembly.dll" --data-folder="D:\TestXboxLive\Builds\\build\bin\x64\Debug\\" -cachedirectory="D:\TestXboxLive\Builds\\build\obj\il2cppOutputProject\x64\Debug\\" -generatedcppdir="D:\TestXboxLive\Builds\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT -dotnetprofile=Net45 -verbose --map-file-parser="D:\TestXboxLive\Builds\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766.
    1>Done building project "Il2CppOutputProject.vcxproj" -- FAILED.
    2>------ Build started: Project: TestXboxLive, Configuration: Debug x64 ------
    2>pch.cpp
    2>App.cpp
    2>Main.cpp
    2>UnityGenerated.cpp
    2>d:\testxboxlive\builds\testxboxlive\app.cpp(26): warning C4973: 'Windows::UI::ViewManagement::IApplicationView2::SuppressSystemOverlays::set': marked as deprecated
    2>d:\testxboxlive\builds\testxboxlive\app.cpp(26): note: Message: 'Use the TryEnterFullScreen method and IsFullScreenMode property instead of SuppressSystemOverlays. For more info, see MSDN.'
    2>LINK : fatal error LNK1104: cannot open file 'D:\TestXboxLive\Builds\build\bin\x64\Debug\GameAssembly.lib'
    2>Done building project "TestXboxLive.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
     
    Last edited: Apr 17, 2017
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    You're using wrong define. #if NETFX_CORE will not work for il2cpp. Use #if ENABLE_WINMD_SUPPORT instead.

    As for that compilation error - for some reason IL2CPP cannot locate a C++ compiler on your machine. Do you use VS2017 or VS2015?
     
  9. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    Ok, define corrected and the magic works *+1 beer*

    I'm using VS2017...
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    I assume you're still getting the il2сpp compilation error?

    Does this file exist on your machine? "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\Hostx64\x64\cl.exe"
     
  11. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    Yes

    Yes but not in Professional, in Community (the version of VS I'm using)
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Could you drop this DLL into <Generated_VS_solution_folder>\il2cppOutputProject\IL2CPP\build\ (you should overwrite existing file), then try to build and paste the output? I added some debug logging to figure out where it's looking for the compiler.
     

    Attached Files:

  13. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    Here you go :

    1>------ Build started: Project: Il2CppOutputProject, Configuration: Master x64 ------
    1>Building GameAssembly.dll with MsvcWinRtToolChain.
    1> Output directory: D:\TestXboxLive\Builds\build\bin\x64\Master
    1> Cache directory: D:\TestXboxLive\Builds\build\obj\il2cppOutputProject\x64\Master
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>Using C++ compiler at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
    1>il2cpp.exe didn't catch exception: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)
    1> --- End of inner exception stack trace ---
    1> at Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[] data, Func`2 action)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    1> at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner(CppProgramBuilder builder, IBuildStatistics& statistics)
    1> at il2cpp.Program.DoRun(String[] args)
    1> at il2cpp.Program.Run(String[] args)
    1> at il2cpp.Program.Main(String[] args)
    1>---> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>---> (Inner Exception #1) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>---> (Inner Exception #2) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>---> (Inner Exception #3) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>---> (Inner Exception #4) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>---> (Inner Exception #5) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>---> (Inner Exception #6) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>---> (Inner Exception #7) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)<---
    1>
    1>
    1>Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
    1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> at Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
    1> at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o)
    1> --- End of inner exception stack trace ---
    1> at Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[] data, Func`2 action)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    1> at Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner(CppProgramBuilder builder, IBuildStatistics& statistics)
    1> at il2cpp.Program.DoRun(String[] args)
    1> at il2cpp.Program.Run(String[] args)
    1> at il2cpp.Program.Main(String[] args)
    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""D:\TestXboxLive\Builds\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x64 -configuration=ReleasePlus -platform=winrt -outputpath="D:\TestXboxLive\Builds\\build\bin\x64\Master\GameAssembly.dll" --data-folder="D:\TestXboxLive\Builds\\build\bin\x64\Master\\" -cachedirectory="D:\TestXboxLive\Builds\\build\obj\il2cppOutputProject\x64\Master\\" -generatedcppdir="D:\TestXboxLive\Builds\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT -dotnetprofile=Net45 -verbose --map-file-parser="D:\TestXboxLive\Builds\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766.
    1>Done building project "Il2CppOutputProject.vcxproj" -- FAILED.
    2>------ Build started: Project: TestXboxLive, Configuration: Master x64 ------
    2>LINK : fatal error LNK1181: cannot open input file 'D:\TestXboxLive\Builds\build\bin\x64\Master\GameAssembly.lib'
    2>Done building project "TestXboxLive.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Hmm, it's picking up the C++ compiler from VS2015. I'll try investigating why this could happen, but in the mean time you could install C++ support into VS2015 and it should fix the error:

    upload_2017-4-19_9-25-35.png
     
  15. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    At list this way it works... I already owe you 3 beers ;)
     
  16. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    Do you have idea why, if I try to use wait, VS says "
    Assets\XboxLiveManager.cs(28,9): error CS4036: 'IAsyncOperation<IReadOnlyList<User>>' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation<IReadOnlyList<User>>' could be found (are you missing a using directive for 'System'?)"
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Maybe you're missing "using System;" at the top of the source file, like the error suggests?
     
  18. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
  19. elettrozero

    elettrozero

    Joined:
    Jun 19, 2016
    Posts:
    216
    I don't understand why, on Debug execution, I constantly receive this error right after splash screen:
    Code (CSharp):
    1.  
    2. onecoreuap\xbox\devices\api\winrt\pnpapiwrapper.cpp(385)\Windows.Gaming.Input.dll!00007FFD9EE72B8C: (caller: 00007FFD9EE76470) ReturnHr(1) tid(6ea0) 8685C003 'Turtle's Quest.exe' (Win32): Loaded 'C:\Windows\System32\deviceaccess.dll'. Cannot find or open the PDB file.
    3. 'Turtle's Quest.exe' (Win32): Loaded 'C:\Windows\System32\ffbroker.dll'. Cannot find or open the PDB file.
    4. onecoreuap\xbox\devices\api\winrt\pnpdevicewatcher.cpp(503)\Windows.Gaming.Input.dll!00007FFD9EE76C72: (caller: 00007FFD9EE762AE) ReturnHr(2) tid(6ea0) 80070057 The parameter is incorrect.
    5. onecoreuap\xbox\devices\api\winrt\pnpdevicewatcher.cpp(503)\Windows.Gaming.Input.dll!00007FFD9EE76C72: (caller: 00007FFD9EE762AE) ReturnHr(3) tid(6ea0) 80070057 The parameter is incorrect.
    6. onecoreuap\xbox\devices\api\winrt\pnpdevicewatcher.cpp(503)\Windows.Gaming.Input.dll!00007FFD9EE76C72: (caller: 00007FFD9EE762AE) ReturnHr(4) tid(6ea0) 80070057 The parameter is incorrect.
    7. onecoreuap\xbox\devices\api\winrt\pnpdevice.cpp(480)\Windows.Gaming.Input.dll!00007FFD9EE73A6F: (caller: 00007FFD9EE6B619) ReturnHr(5) tid(6ea0) 80070020 The process cannot access the file because it is being used by another process.
    8. onecoreuap\xbox\devices\api\winrt\pnpdevicewatcher.cpp(503)\Windows.Gaming.Input.dll!00007FFD9EE76C72: (caller: 00007FFD9EE762AE) ReturnHr(6) tid(6ea0) 80070020 The process cannot access the file because it is being used by another process.
    9. onecoreuap\xbox\devices\api\winrt\pnpdevicewatcher.cpp(503)\Windows.Gaming.Input.dll!00007FFD9EE76C72: (caller: 00007FFD9EE762AE) ReturnHr(7) tid(6ea0) 80070057 The parameter is incorrect.
    10. onecoreuap\xbox\devices\api\winrt\pnpapiwrapper.cpp(385)\Windows.Gaming.Input.dll!00007FFD9EE72B8C: (caller: 00007FFD9EE76470) ReturnHr(8) tid(6ea0) 8685C003 onecoreuap\xbox\devices\api\winrt\pnpapiwrapper.cpp(385)\Windows.Gaming.Input.dll!00007FFD9EE72B8C: (caller: 00007FFD9EE76470) ReturnHr(9) tid(6ea0) 8685C003 Exception thrown at 0x00007FFDAB7F9E08 in Turtle's Quest.exe: Microsoft C++ exception: _com_error at memory location [0x000000AAFAFF8D50].
    11. Exception thrown at 0x00007FFDAB7F9E08 in Turtle's Quest.exe: Microsoft C++ exception: _com_error at memory location [0x000000F69ABF8AD0].
    12.  
    The memory location changes.
     
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Do you have a callstack for that?
     
  21. pb0o6

    pb0o6

    Joined:
    Apr 2, 2014
    Posts:
    3
    Hi,

    I believe I have the same issue as being described above.
    I have built a Windows Store build in Unity 5.6.0f3 using Scripting backend 'Il2CPP' and API Compatability Level'.NET 4.6'
    I opened the solution in Visual Studio Community 2017 (The only version of VS I currently have access to), and I am greeted with the following warning:


    Upon setting the target to x64 and Building the solution, I receive the following log:


    This seems to me to be the same issue, but honestly this is the first time I've tried to build a UWP project, and I'm not very familiar with Visual Studio, so I'm not really sure how related they are. The output logs seem similar to me.

    Is it possible to install whatever VS 2015 build tools the project is looking for to VS2017, or will I need to find a download of Visual Studio 2015 somewhere?
     
  22. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    @pb0o6 are you able to create a C++ project targeting UWP in Visual Studio and run it? If something is not installed in VS2017, it should trigger installation of it. If it does work, and Unity compilation still doesn't, it means you're hitting the same issue of Unity being unable to locate VS2017 (I have yet to investigate why that would happen), and it means you'll have to install VS2015.
     
  23. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    Hi,

    I have the same issue as being described above.
    Then I get the .dll on #12.
    the error changed as this:

    il2cpp.exe didn't catch exception: System.MissingMethodException: 找不到方法:“Void Unity.IL2CPP.Building.BuildDescriptions.IL2CPPOutputBuildDescription..ctor(....
     
  24. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    Void Unity.IL2CPP.Building.BuildDescriptions.IL2CPPOutputBuildDescription..ctor(NiceIO.NPath, NiceIO.NPath, NiceIO.NPath, Unity.IL2CPP.Common.DotNetProfile, Unity.IL2CPP.Building.CppToolChain, NiceIO.NPath, Boolean, Boolean, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<NiceIO.NPath>, System.Collections.Generic.IEnumerable`1<NiceIO.NPath>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, NiceIO.NPath)
     
  25. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Can you paste your editor log?
     
  26. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    Post reply occur some error:your content is spam-like or contains inappropriate elements.so i try Divided the editor log into two parts.
    first:
    1>il2cpp.exe didn't catch exception: System.MissingMethodException: cannot find method:

    Void Unity.IL2CPP.Building.BuildDescriptions.IL2CPPOutputBuildDescription..ctor(NiceIO.NPath, NiceIO.NPath, NiceIO.NPath, Unity.IL2CPP.Common.DotNetProfile, Unity.IL2CPP.Building.CppToolChain, NiceIO.NPath, Boolean, Boolean, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<NiceIO.NPath>, System.Collections.Generic.IEnumerable`1<NiceIO.NPath>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, NiceIO.NPath)
     
  27. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    second:
    1> il2cpp. Program. DoRun(String[] args)
    1> il2cpp. Program. Run(String[] args)
    1> il2cpp. Program.Main(String[] args)
     
  28. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Which Unity version are you on? That DLL was only compatible with Unity 5.6. Looks like you're on a different Unity version.
     
  29. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    My unity version is 5.5..........
     
  30. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    Here is the initial editor log:

    1>Building GameAssembly.dll with MsvcWinRtToolChain.
    1> Output directory: D:\proj.zombie\UWP\build\bin\Win32\Debug
    1> Cache directory: D:\proj.zombie\UWP\build\obj\il2cppOutputProject\Win32\Debug
    1>il2cpp.exe didn't catch exception: System.AggregateException: One or more errors occurred。 ---> System.ComponentModel.Win32Exception: The system can not find the file specified。
    1> 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> 在 Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> 在 Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(CppCompilationInstruction cppCompilationInstruction)
    1> 在 Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)
    1> --- 内部异常堆栈跟踪的结尾 ---
    1> 在 Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[] data, Func`2 action)
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile)
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.Build()
    1> 在 il2cpp.Program.DoRun(String[] args)
    1> 在 il2cpp.Program.Run(String[] args)
    1> 在 il2cpp.Program.Main(String[] args)
    1>---> (内部异常 #0) System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。
    1> 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> 在 Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> 在 Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(CppCompilationInstruction cppCompilationInstruction)
    1> 在 Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (内部异常 #1) System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。
    1> 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> 在 Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> 在 Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(CppCompilationInstruction cppCompilationInstruction)
    1> 在 Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (内部异常 #2) System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。
    1> 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> 在 Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> 在 Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(CppCompilationInstruction cppCompilationInstruction)
    1> 在 Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>---> (内部异常 #3) System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。
    1> 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> 在 Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> 在 Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(CppCompilationInstruction cppCompilationInstruction)
    1> 在 Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)<---
    1>
    1>
    1>未经处理的异常: System.AggregateException: 发生一个或多个错误。 ---> System.ComponentModel.Win32Exception: 系统找不到指定的文件。
    1> 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    1> 在 Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
    1> 在 Unity.IL2CPP.Building.CompilationInvocation.Execute()
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(CppCompilationInstruction cppCompilationInstruction)
    1> 在 Unity.IL2CPP.Building.ParallelFor.<RunWithResult>c__AnonStorey1`2.<>m__0(Object o)
    1> --- 内部异常堆栈跟踪的结尾 ---
    1> 在 Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[] data, Func`2 action)
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile)
    1> 在 Unity.IL2CPP.Building.CppProgramBuilder.Build()
    1> 在 il2cpp.Program.DoRun(String[] args)
    1> 在 il2cpp.Program.Run(String[] args)
    1> 在 il2cpp.Program.Main(String[] args)
     
  31. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Check my post from #14. Modify your VS2015 installation in "Programs and Features" and make sure those C++ checkboxes are checked.
     
  32. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    my vs version is 2017.so the installation options is not same as 2015,but i install almost all plugin about c++.
    and when i open the c++ project, i get a warning:
    D:\UWPTest \UWPTestProject\cLL\Il2CppOutputProject\Il2CppOutputProject. vcxproj : warning : Can not find the Visual Studio 2015 (v140) generation tool
    is it helpful? and how can i solved this warning.
    i am very sorry about my chinese English
     
  33. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
  34. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    it did not work.
    that issue is really similar as mine.but it is a little different:my exception is System.AggregateException,his exception is System.InvalidOperationException.
    i am trying google with the key world "System.AggregateException" to find some clue.

    by the way, what is MsvcWinRtToolChain? is it a tool plugin? why i can not find any file named MsvcWinRtToolChain?
     
  35. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    I don't think googling will help - the issue is that Unity cannot locate a C++ compiler on your machine. If you create a brand new C++ project targeting Universal Windows in Visual Studio, are you able to build it? If not, it means you're missing some C++ components.

    MsvcWinRtToolChain is one of our classes that handles C++ code compilation.

    Are you able to upgrade to Unity 5.6? I'm not sure what state Unity 5.5 was in regards to C++ compilation with VS2017. Otherwise, could you try installing VS2015?
     
  36. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    i got it.
    when install vs2017, Game development with Unity has a option:Unity 5.6 Editor.i thought this is download the unity editor of version 5.6(maybe it is true).i choice this want it can help me update my unity to 5.6,but it is over very quickly(although the size needed is 2.9G).but at last, my build is success.
    I feel very surprised. and thanks for your help.
     
  37. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    i have another question. if i want build my unity uwp project with .Net mode.is there an elegant way to solve the Net version problem?:
    The .NET Scripting Backend is using Microsofts .NET to power scripting. Unlike other Unity platforms, Windows Store is not using .NET 3.5 Class Libraries profile, but rather a subset of .NET 4.5. This is due to Windows Store certification requirements. This means that the platform has some incompatibilities compared to other platforms, such as different plugin model and many missing types that are present in .NET 3.5 profile that Unity normally uses.
    my uwp project has my error about .Net version using .Net building.
     
  38. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Unfortunately no. The only solution is to use IL2CPP. That's why we made it available in the first place. Is there any reason you don't want to use IL2CPP?
     
  39. AppleKey

    AppleKey

    Joined:
    Jun 5, 2017
    Posts:
    11
    1.every time i changed my c# code, i need build it with my unity.
    2.in the compiled c++ project, i cannot find my unity c# code, it is no way to debug the project.
    3.if the compiled c++ project error, it is hard to find the reason because the code is unreadable
     
  40. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,681
    Fair points. We're addressing 2) and 3) by building a debugger. It's still work in progress, and will take a couple of Unity releases to finish.
     
    Deviant_Spark likes this.