Search Unity

[WindowsStore] [IL2CPP] Cant build solution. Object reference not set to an instance of an object.

Discussion in 'Windows' started by SkobbejakGames, Oct 18, 2018.

  1. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    Hi,

    I am trying to build our UWP game in Visual Studio but I get the following errors:

    Code (CSharp):
    1. 1>------ Build started: Project: Il2CppOutputProject, Configuration: Master x64 ------
    2. 1>Object reference not set to an instance of an object.
    3. 2>------ Build started: Project: Tyd wag vir Niemand, Configuration: Master x64 ------
    4. 2>Object reference not set to an instance of an object.
    5. ========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
    I never used to have this problem, but a Windows Update bug caused Developer Mode and Developer Tools to get messed up and I needed to format and do a clean Windows installation. I've gotten everything installed and set up how I had it but for some reason when I try to build my project I get the error above now and I cant seem to figure out how to get more info on the matter.

    I'm using Unity 2017.4.11 and Visual Studio 2017 Pro on Windows 10 Pro 64bit

    Please any help would be greatly appreciated.
     
  2. RaulOses

    RaulOses

    Joined:
    Jul 10, 2017
    Posts:
    714
    Hi SkobbejakGames,

    Unfortunately, that error message doesn't say anything that we can look at, can you share with us the whole log while compiling the player?

    Also, is possible for you to verify if you can build a UWP player using an empty project?

    Regards,
     
  3. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    @RaulOses

    Thanks for the reply.

    Where do I access the whole log as this is the only info that the Output in VS2017 gives me?

    I did try a new clean UWP project and I still get the same results, I also tried to delete the IL2CPP project and then rebuild from Unity, but I still got the same results.

    One thing that I noticed ever since I formatted, did a clean windows install and installed visual studio and all necessary software, when I build out a UWP build the UnityCommon.props doesnt get placed in the right directory as when I open the solution the main game's solution wont load (with a load failed or unavailable message) while the IL2CPP and UnityData projects load just fine in the solution.

    Its only when I copy the UnityCommon.props file into the build sub folder for the game's project that the project loads successfully in the solution. I am attaching a pic to help illustrate. Im not sure if this might give a clue or might be related.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Looks like your last pic didn't load. What exact VS version are you on?
     
  5. BoxFrogGames

    BoxFrogGames

    Joined:
    Jan 25, 2018
    Posts:
    9
    I appear to be having the exact same problem, my project was building fine, and then suddenly not. I even get the issue with UnityCommon.props too...

    Visual Studio did prompt to install some updates (I wish I can remember what - I think some C++ related things) and then the next time I went to build I was getting the same error as the OP.

    Unity 2018.2.11f1

    Visual Studio info from the Help -> About dialog:

    Code (CSharp):
    1. Microsoft Visual Studio Community 2017
    2. Version 15.8.7
    3. VisualStudio.15.Release/15.8.7+28010.2046
    4. Microsoft .NET Framework
    5. Version 4.7.03056
    6.  
    7. Installed Version: Community
    8.  
    9. Visual C++ 2017   00369-60000-00001-AA707
    10. Microsoft Visual C++ 2017
    11.  
    12. Application Insights Tools for Visual Studio Package   8.13.10627.1
    13. Application Insights Tools for Visual Studio
    14.  
    15. ASP.NET and Web Tools 2017   15.8.05085.0
    16. ASP.NET and Web Tools 2017
    17.  
    18. C# Tools   2.9.0-beta8-63208-01
    19. C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
    20.  
    21. Common Azure Tools   1.10
    22. Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
    23.  
    24. JavaScript Language Service   2.0
    25. JavaScript Language Service
    26.  
    27. JavaScript Project System   2.0
    28. JavaScript Project System
    29.  
    30. Microsoft JVM Debugger   1.0
    31. Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
    32.  
    33. Microsoft MI-Based Debugger   1.0
    34. Provides support for connecting Visual Studio to MI compatible debuggers
    35.  
    36. Microsoft Visual C++ Wizards   1.0
    37. Microsoft Visual C++ Wizards
    38.  
    39. Microsoft Visual Studio VC Package   1.0
    40. Microsoft Visual Studio VC Package
    41.  
    42. MLGen Package Extension   1.0
    43. MLGen Package Visual Studio Extension Detailed Info
    44.  
    45. NuGet Package Manager   4.6.0
    46. NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
    47.  
    48. ProjectServicesPackage Extension   1.0
    49. ProjectServicesPackage Visual Studio Extension Detailed Info
    50.  
    51. ResourcePackage Extension   1.0
    52. ResourcePackage Visual Studio Extension Detailed Info
    53.  
    54. Test Adapter for Boost.Test   1.0
    55. Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.
    56.  
    57. Test Adapter for Google Test   1.0
    58. Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.
    59.  
    60. TypeScript Tools   15.8.20822.2001
    61. TypeScript Tools for Microsoft Visual Studio
    62.  
    63. Visual Basic Tools   2.9.0-beta8-63208-01
    64. Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
    65.  
    66. Visual Studio Code Debug Adapter Host Package   1.0
    67. Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
    68.  
    69. Visual Studio Tools for CMake   1.0
    70. Visual Studio Tools for CMake
    71.  
    72. Visual Studio Tools for Unity   3.8.0.7
    73. Visual Studio Tools for Unity
    74.  
    75. Visual Studio Tools for Universal Windows Apps   15.0.28010.2046
     
  6. RaulOses

    RaulOses

    Joined:
    Jul 10, 2017
    Posts:
    714
    Hi guys,

    @SkobbejakGames, can you verify if you have installed these packages:
    • C++ Universal Windows Platform tools
    • .NET Framework 4.7.1 SDK
    • Windows 10 SDK (10.0.17134.0)
    • Windows 10 SDK (10.0.16299.0) for UWP: C++
    • Visual C++ runtime for UWP

    As this thread is not related to Xbox One, I'll be moved to our UWP and Windows application forums.

    Regards,
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    This looks like a crash inside MSBuild when building the project. Unfortunately I have no idea what could cause that. Is there any chance you could try reinstalling VS2017?
     
  8. BoxFrogGames

    BoxFrogGames

    Joined:
    Jan 25, 2018
    Posts:
    9
    Although not directed at me, I'll answer anyway :)

    I checked all those packages listed above, and confirmed that the issue wasn't there. So I did a full uninstall of VS2017, and then reinstalled it and all the relevant packages. THAT seemed to work.

    However, sometimes VS will prompt you to install packages when you've done a new build from within Unity - packages that I'm pretty sure are already there... you can skip this prompt, and if you do it seems everything work ok. If you choose to install them, then it looks like it's screwing something up during the configuring of them.

    I guess it's some bizarre bug in VS? *shrug*
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Yeah, we don't trigger any installation of components from our generated solutions - VS probably just looks at it and thinks "oh I'm missing this".
     
  10. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    @Tautvydas-Zilys @RaulOses

    I managed to solve the issue by completely re-installing Visual Studio 2017 and all the necessary components needed for UWP game development and Im able to build out and deploy a package.

    However, I cant seem to sync any of my developer accounts with the cloud and the game doesnt seem to want to save or load any Connected Storage data to the cloud.

    I am attaching an image to help illustrate.
     

    Attached Files:

  11. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    I noticed that when the game starts up the TitleID and the SCID both gets read as 0.

    However, I do have my xboxservices.config set up with my TitleId and PrimaryServiceConfigId and I have it imported into my UWP solution as well as the Content set to True. I have also Associated the App with the Store and packaged it under the title and publisher's identity.

    One thing that I do notice is that I cant seem to find the TitleId or the PrimaryServiceConfigId in the new Partner Center in either the App Identity section or the Xbox Live Config section.

    Are the TitleId and the PrimaryServiceConfigId set up differently under the new system, would it have changed the set up process in any sense?

    Please any help on the matter would be greatly appreciated.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Do you have access to id@Xbox forums? I'm afraid I lack the expertise to answer this question, and that would be a better place to ask it as it's directly related to their systems rather than IL2CPP.
     
  13. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    Ok, I managed to fix the issue as it seems that the setup for Windows Store games has changed again and you now need to use the decimal version of the TitleID in the xboxservices.config, not the Hexadecimal version, and there are also 2 new parameters that need to be included in the xboxservices.config

    However, it seems that the Stats implementation has also changed as my Stats were working fine previously but now Stats wont update anymore.

    Here is how I have my Stats Set up:

    Var Definition:

    Code (CSharp):
    1. Microsoft.Xbox.Services.Statistics.Manager.StatisticManager StatisticsManager;
    Initialization:

    Code (CSharp):
    1. StatisticsManager = Microsoft.Xbox.Services.Statistics.Manager.StatisticManager.SingletonInstance;
    2. StatisticsManager.AddLocalUser(m_user);
    3. StatisticsManager.DoWork();
    Updating Stats:

    Code (CSharp):
    1. StatisticsManager.SetStatisticNumberData(m_user, "ExtraCompletion", XOneInter.xboxinter.ExtraPercentage);
    2. StatisticsManager.DoWork();
     
  14. BoxFrogGames

    BoxFrogGames

    Joined:
    Jan 25, 2018
    Posts:
    9
    @SkobbejakGames Could you let me know what these additional parameters are? I've been having an email exchange with ID@Xbox and the rep and I are running low on fresh ideas for my sign in issues.

    -Craig
     
  15. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    Hi,

    I managed to fix the issue by following the new setup laid out by this link:

    https://docs.microsoft.com/en-us/windows/uwp/xbox-live/xboxservices-config

    Also, nothing was wrong with our Stats setup I forgot that in order to test Stats updating in a pre-release debugging environment you have to request a flush in order to confirm if your setup is correct and then remove the request flushes from your code when your ready to build and submit you final release.

    However, I have a new problem, when I try to run the Windows App Cert Kit (WACK) the test doesnt run completely and closes halfway without any report or indication what is preventing it from running completely.

    I am running Windows 10 Pro 64bit 10.0.17134.0 with Windows SDK 10.0.17134.12 and Im running Unity 2017.4.11 as well as the latest UWP XboxLive Unity plugin.

    Ive noticed that there is a new Windows SDK available 10.0.17763.1 however this seems to correspond
    with a newer Windows Insider Program beta release and Im not sure if I need to update to the latest version
    of the Windows SDK as when I installed the latest SDK I got the WACK to run completely but it gave me a FAILED report with a bunch of test fails that I never previously had with the previous versions of the SDK and WACK, Im not sure if these errors have anything to do with not having the latest beta Windows 10 version (that seems to correspond with the latest SDK) installed?

    Please, any help on the matter would be greatly appreciated as we are trying to get our submission in asap in order to get the game finalized and approved in time for a 21/12 Release and Pre-Orders starting on 7/12.
     
    Last edited: Nov 15, 2018
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    What are the failed tests you're getting?
     
  17. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    Here is the WACK report that I manage to get from SDK 10.0.17763.1 but Im not sure if I should be following this particular SDK version on my version of Windows 10.
     

    Attached Files:

  18. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    There are 2 or 3 errors that I can figure out and should be able to solve reasonably easily, such as finding out what the new Minimum Supported OS Version should be (is there some kind of documentation that gets updated with this info?) however most of them I cant seem to find a cause or a reason for and I never used to receive them with our previous release our when I was developing the new game on the previous versions of Unity and UWP sdk.
     
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    That looks like WACK is totally busted on your machine. Does it pass on an empty app created from VS? I'd suggest reinstalling it.

    Also, I recommend against using WACK from a preview version of SDK. It may have issues and report false positives.
     
  20. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    Hi, Thanks for the prompt reply and the info.

    I just wanted to check if I need all the previous versions of the Windows SDK installed along with ver. 10.0.17134.12?

    Also Im sitting with a bit of an issue, once I installed the SDK associated with beta Insider Program release (10.0.17763.1) the WACK seems to be stuck on that version even after I uninstalled the SDK. I then deleted the Windows App Cert Kit folder but when I install the SDK that Im supposed to be on it doesnt want to install the WACK even if I install directly from their own Installers.

    What would be the best way to solve the issue, can I uninstall all of the SDK versions and only install the latest stable version or should I install all of the older SDK versions before I install the SDK version I should be on? Can I delete th Windows Kits folder if need be?

    Please any help on the matter would be greatly appreciated.
     
  21. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
  22. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    @Tautvydas-Zilys Thanks for the reply. Yes, Ive downloaded all of the SDKs from the Archive from the Anniversary Update version up until 10.0.17134.12. Should I download and install the earlier versions as well?

    However, Im not sure if I should install all of them or only 10.0.17134.12? Also when I uninstall the SDKs (even when I uninstall all of the currently installed ones) the Windows 10 Kits folder in Program Files still seems to stay there including the WACK (even when I uninstall the seperate packages for WACK). Do I have to delete the Windows 10 Kits folder before installing the appropriate SKD(s)?

    Another thing that I have noticed is the only way to get the WACK re-installed properly and have the folder show up after being deleted is to uninstall it from control panel as well as the current SDK and then re-install.

    Finally, it doesnt seem like the X64 version of the WACK is not installing even if I install it directly from its own Installer and only the X86 version is being installed, Im wondering if that might not be the reason that the WACK just closes while testing our game?
     
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    You should be able to only install the newest one. You should also be able to delete WACK folder manually and try installing the SDK again.

    How can you tell that WACK is 32-bit on your machine?
     
  24. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    @Tautvydas-Zilys I only see the x86 WACK installed in Control Panel, I cant confirm if the x64 is installed as I dont see it anywhere in Control Panel.
     
  25. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    @Tautvydas-Zilys Also should I uninstall the Windows Mobile Connectivity Tools and Windows SDK AddOn before installing re-installing the SDK?
     
  26. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I don't think those are related.
     
  27. SkobbejakGames

    SkobbejakGames

    Joined:
    Jun 3, 2016
    Posts:
    396
    @Tautvydas-Zilys Ok, Ive tried re-installing the SDK even deleting the contents of the Windows Kits\10\ folder and then re-installing the SDK and I still get the same result, the WACK will start running the tests and then it just closes on its own.

    One thing that I releasised is that it didnt install the WACK automatically when I installed the SDK only the Supported API List for x64, x86 and ARM. I had to manually install the rest of the WACK from the specific individual installers. Also there doesnt appear to be an Installer file for Windows App Certification Kit SupportedApiList x64-x86_en-us although the SupportedAPIs-x64.xml is present in the Windows Kits\10\ folder. Additionally, when I manually installed the WACK from the specific installers I noticed that only the x86 installers actually appear to install something where the x64 installers just seem to close immediately after opening them, I can also see in Apps under Control Panel that only the x86 version of the WACK appears to be installed.

    Please, any help or advice on the matter would be greatly appreciated.
     
  28. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    At this point, I strongly believe your machine state is just messed up. Since you're in a hurry, I suggest setupping a VM with a fresh window installation and install WACK there.
     
  29. jktaylo1

    jktaylo1

    Joined:
    Apr 18, 2017
    Posts:
    2
    Thanks @SkobbejakGames I have been struggling to find a solution for this for days and reinstall of Visual Studio did the trick! I think I too hit a windows update that caused this. The reinstall was four hours of my life I will never get back. I hope it does not happen again.