Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Universal 10 >> Exception: Failed to restore NuGet packages

Discussion in 'Windows' started by Alvin-o0O, Sep 13, 2015.

  1. Alvin-o0O

    Alvin-o0O

    Joined:
    Dec 12, 2014
    Posts:
    16
    I build an empty project with Visual Studio 2015 RTM + Unity 5.2
     

    Attached Files:

  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Scroll down to see why it failed to restore nuget packages, addtionally try creating Universal 10 app from VS 2015 and see if it runs fine there.
     
    Alvin-o0O likes this.
  3. Alvin-o0O

    Alvin-o0O

    Joined:
    Dec 12, 2014
    Posts:
    16
    Thanks Tomas1856 , I have already got it now !
     
  4. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    How did you solve it? I'm having this problem atm, and need it fixed... :D

    EDIT: nvm, the workaround was to build a UWP app in VS2015 first, of which corrects the problem. :)
     
    Last edited: Dec 5, 2015
  5. pappu33

    pappu33

    Joined:
    Apr 8, 2015
    Posts:
    14
    any project? should it be same name?
     
  6. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Any project. I've also noticed that some failures were triggered by having no internet, (Wow Microsoft...) just make sure your internet is up, then build your project. Sometimes, a whole lot of errors and warnings will pop up, but in most cases, they're false, as the game builds fine regardless.

    EDIT: Also, you don't need the same name.
     
  7. 4443

    4443

    Joined:
    Dec 14, 2015
    Posts:
    3
    i am using unity 5.3.0f4, windows 10 64bit , VS 2015
    i can't to build my game in windows store platform....
    plz help me
     

    Attached Files:

  8. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    @4443, something went wrong with restoring Nuget packages, things to try:
    * delete C:\Users\<user>\.nuget directory, note it's hidden, ensure that you can see hidden directories

    or

    * don't use build & run, simply build, open generated solution and try to run then
     
  9. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    "* don't use build & run, simply build, open generated solution and try to run then"
    People, listen to this one... :D It's the only way I got my machine to build anything.

    And for nuGet errors, I found connecting to the internet solved the problem. the nuGet package restore might also throw errors for no reason, in that the build will still run fine. :)
     
  10. 4443

    4443

    Joined:
    Dec 14, 2015
    Posts:
    3
    its not working guys , after delete .nuget directory...
    any other method...???
    i just simply install the vs 2015 i didn't change any setting before install...i did wrong????
     
  11. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    @4443 try creating Universal application from VS 2015, maybe you're missing some SDK.
     
  12. 4443

    4443

    Joined:
    Dec 14, 2015
    Posts:
    3
    which is more important from VS 2015 before install.......
     
  13. hamokshaelzaki

    hamokshaelzaki

    Joined:
    Nov 6, 2012
    Posts:
    19
    I had the same problem, reinstalling the Universal SDK from the VS installer (it will isA need to download something during the installation, leave it) solved the problem for me.
     
  14. sticoRobotto

    sticoRobotto

    Joined:
    Aug 25, 2013
    Posts:
    1
    Thanks for fixing the problem that I had with trying to build this thing. Wish I had found this tread about 2 hours ago. :)
     
  15. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    You're welcome. :)
    On the other hand, I forgot this thread existed, lol. XD
     
  16. gaetancovelli

    gaetancovelli

    Joined:
    Jul 26, 2016
    Posts:
    1
    Hi, I had the same problem and the proposed solutions here didn't work for me.
    However, I was able to solve the problem by uptating the Nuget package manager used by Unity.

    I opened a command prompt and navigated to C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Tools
    Then updated nuget.exe with the following command: nuget.exe update -self

    I restarted Unity and then I was able to build my project. Hope that helps.
     
    christougher likes this.
  17. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Huh, i had no idea Unity had it's own nuget executable. Maybe I should update mine, lol. XD
    I was able to build games regardless of most of the errors I got (aka. they didn't actually affect my game's builds at the time I got them)
     
  18. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    This did the trick for me. Thx!
     
  19. wjnp

    wjnp

    Joined:
    Mar 22, 2017
    Posts:
    3
    l am using unity 5.6.0f1, windows 10 64bit , VS 2015
    l can't to build my game in windows store platform....
    help me
     

    Attached Files:

  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Can you post your editor log?
     
  21. wjnp

    wjnp

    Joined:
    Mar 22, 2017
    Posts:
    3
    Thank you for your help,my editotlog:
     

    Attached Files:

  22. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    The log you attached does not have that error...
     
  23. wjnp

    wjnp

    Joined:
    Mar 22, 2017
    Posts:
    3
    There are other words :
    stdout:
    MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
    Feeds used:
    C:\Users\Administrator\AppData\Local\NuGet\Cache
    https://api.nuget.org/v3/index.json
    C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
     
  24. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    The editor log says the build failed because you have compiler errors in your scripts:

    Code (csharp):
    1.  
    2. -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll
    3. Compilation failed: 6 error(s), 0 warnings
    4. -----CompilerOutput:-stderr----------
    5. Assets/BuildDeployTools.cs(30,13): error CS0103: The name `BuildSLNUtilities' does not exist in the current context
    6. Assets/BuildDeployTools.cs(142,17): error CS0103: The name `BuildDeployWindow' does not exist in the current context
    7. Assets/BuildDeployTools.cs(150,53): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    8. Assets/BuildDeployTools.cs(153,99): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    9. Assets/BuildDeployTools.cs(163,79): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    10. Assets/BuildDeployTools.cs(173,79): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    11. -----EndCompilerOutput---------------
    12. - Finished compile Library/ScriptAssemblies/Assembly-CSharp.dll
    13. Assets/BuildDeployTools.cs(30,13): error CS0103: The name `BuildSLNUtilities' does not exist in the current context
    14. (Filename: Assets/BuildDeployTools.cs Line: 30)
    15.  
    16. Assets/BuildDeployTools.cs(142,17): error CS0103: The name `BuildDeployWindow' does not exist in the current context
    17. (Filename: Assets/BuildDeployTools.cs Line: 142)
    18.  
    19. Assets/BuildDeployTools.cs(150,53): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    20. (Filename: Assets/BuildDeployTools.cs Line: 150)
    21.  
    22. Assets/BuildDeployTools.cs(153,99): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    23. (Filename: Assets/BuildDeployTools.cs Line: 153)
    24.  
    25. Assets/BuildDeployTools.cs(163,79): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    26. (Filename: Assets/BuildDeployTools.cs Line: 163)
    27.  
    28. Assets/BuildDeployTools.cs(173,79): error CS0103: The name `BuildDeployPrefs' does not exist in the current context
    29. (Filename: Assets/BuildDeployTools.cs Line: 173)
    30.  
    31. EditorUpdateCheck: Response {updateinterval: '3600'} updateurl =  interval = 3600
    32. Monitor request failed, Reason: Operation timed out after 5000 milliseconds with 0 out of 0 bytes received (0).
    33. An error occured while processing request "https://api.unity.com/v1/users/12369547604262/force-login-required", HTTP error code 0
    34. .[UnityConnect] An error occured.
    35. An error occured while processing request "https://core.cloud.unity3d.com/api/login", HTTP error code 299
    36. .[UnityConnect] An error occured.
    37. Issue TrimJob to reduce GI Cache size to maximum 10GB at: 'C:/Users/Administrator/AppData/LocalLow/Unity/Caches/GiCache'
    38. [00:00:01] Enlighten: Precompute started.
    39. TrimDiskCacheJob: Current cache size 0mb
    40. [00:00:01] Enlighten: Finished 1 Layout Systems job (0.00s execute, 0.00s integrate, 0.05s wallclock)
    41. [PathTracer][LP] Issuing deduplication and tetrahedralization job. Combined: 80257199cfa681a16be5e09b3c2208f4, tetrahedralized probes: 00000000000000000000000000000000, non-tetrahedralized probes: 00000000000000000000000000000000, dependencies: 00000000000000000000000000000000
    42. [00:00:01] Enlighten: Finished 1 Tetrahedralize Probes job (0.01s execute, 0.00s integrate, 0.05s wallclock)
    43. [00:00:01] Enlighten: Precompute took 0.107272 seconds.
    44. Enlighten scene contents:   0 geometries.   0 instances.   0 systems.   0 probe groups.   0 cube maps. Scene is up-to-date.
    45. [00:00:01] Enlighten: Bake started.
    46. [PathTracer][LP] Integrating deduplicated and tetrahedralized probes for hash 80257199cfa681a16be5e09b3c2208f4.
    47. Setting up 2 worker threads for Enlighten.
    48.   Thread -> id: 20ac -> priority: 1
    49.   Thread -> id: 15dc -> priority: 1
    50. [00:00:01] Enlighten: Finished 1 Bake Runtime job (0.15s execute, 0.00s integrate, 0.16s wallclock)
    51. [00:00:01] Enlighten: Bake took 0.157799 seconds.
    52. [PathTracer] Lightmap reset.
    53. [PathTracer][LP] Light probes reset.
    54. [PathTracer] building lightmap data asset.
    55. [00:00:02] Enlighten: Reflection Probes started.
    56. [00:00:02] Enlighten: Finished 1 Ambient Probes job (0.00s execute, 0.00s integrate, 0.05s wallclock)
    57. [00:00:02] Enlighten: Finished 1 Reflection Probes job (0.00s execute, 0.00s integrate, 0.05s wallclock)
    58. <RI> Initialized touch support.
    59.  
    60. Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.002367 seconds (Nothing changed)
    61. WARNING: Shader Unsupported: 'Hidden/VideoDecodeOSX' - Pass 'FLIP_RGBARECT_TO_RGBA' has no vertex shader
    62. WARNING: Shader Unsupported: 'Hidden/VideoDecodeOSX' - Setting to default shader.
    63. WARNING: Shader Unsupported: 'Hidden/VideoDecodeAndroid' - Pass 'RGBAEXTERNAL_TO_RGBA' has no vertex shader
    64. WARNING: Shader Unsupported: 'Hidden/VideoDecodeAndroid' - Pass 'RGBAEXTERNAL_TO_RGBA' has no vertex shader
    65. WARNING: Shader Unsupported: 'Hidden/VideoDecodeAndroid' - Setting to default shader.
    66. Platform assembly: C:\Program Files\Unity\Editor\Data\Managed\Unity.CecilTools.dll (this message is harmless)
    67. DisplayProgressNotification: Build Failed
    68. Error building Player because scripts have compile errors in the editor
    69. (Filename:  Line: -1)
     
  25. feuPower

    feuPower

    Joined:
    Sep 3, 2017
    Posts:
    1
    I have the same problem...and I have tried those methods above but they can't fixed my problem...I'm feel so terrible
    There are other words :

    Failed to restore NuGet packages


    UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    UnityEditor.HostView:OnGUI()
     
  26. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    ^ can you post your editor log?
     
  27. johnclarke919

    johnclarke919

    Joined:
    Sep 19, 2017
    Posts:
    1
    I was having trouble getting this to work on my work network, the NuGet API it is trying to call is served on port 18000 and it was being blocked by the firewall. I was able to switch to a Wifi hotspot and it built flawlessly