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. Dismiss Notice

"Cannot Resolve Symbol" - Rider, Windows, Resolve symbols between Editor and Runtime Assemblies

Discussion in 'Editor & General Support' started by majeric, Apr 12, 2020.

  1. majeric

    majeric

    Joined:
    Aug 17, 2010
    Posts:
    88
    So, I opened my pet Unity project on my Windows box and because I've been using Rider at work on my Mac, I thought I would give it a go in Windows. However, I can't figure out why Rider can't resolve symbols.

    Unity 2019.3 / Rider 2019.3

    I imagine it must be the compiler configuration but none of the suggestions that I come across on the net thus far works. I open my project on my Mac and Rider resolves all the symbols just fine. The Unity project itself compiles and runs just fine in both Mac and Windows. It's definitely a rider config problem. i just have no idea what.
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Hello,

    Did you explicitly setup Rider as your scripting IDE, by choosing it in Unity > Preferences > External Tools > External Script Editor?

    If so, try to close the solution, delete all the project and solution files and then choose Assets > Open C# Project.

    I hope that you can figure it out soon!
     
  3. majeric

    majeric

    Joined:
    Aug 17, 2010
    Posts:
    88
    Thank you for replying. Unfortunately this was among the first things that I tried. I’m aware of how unity generates The solution and project files.
     
  4. majeric

    majeric

    Joined:
    Aug 17, 2010
    Posts:
    88
    Rider works for my project on my mac... but not on windows. Rider works in Windows with the Tutorial projects... I feel like I might have to rebuild my project from individual source files.
     
  5. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Another thing that you can do is:
    • Close Unity and Unity Hub;
    • Delete the Library folder;
    • Delete all the project (.csproj) and solution (.sln) files;
    • Open your Unity project;
    • Choose again Assets > Open C# Project.
    Let me know if this works :)
     
    wjlpld, styGGx and glolutphoenix like this.
  6. Svendeha

    Svendeha

    Joined:
    Nov 26, 2019
    Posts:
    1
    I'm having a similar issue and both suggestions did not work unfortunately.
    Also checked Settings -> Toolset and Build settings within Resharper but everything seems to be okay.

    It's weird because packages like TextMeshPro are giving me problems as well. For example using TMPro is flagged as red and it says "Cannot resolve symbol TMPro".

    I'm having a lot of errors in solution in rider but Unity compiles fine and I can run in editor with no problem. Any help is greatly appreciated!
     
  7. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    404
    Hmm. I have the same problem with another asset. Is deleting the library the only way to rebuild them? Can't you do it for a specific asset?
     
  8. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    404
    I might have fixed it! I went to the solution view, right clicked the asset and chose clean and rebuild, or something like that. The errors went away for now, but it's processing something now, so not sure if it will come back..
     
  9. ColdPixel

    ColdPixel

    Joined:
    May 22, 2019
    Posts:
    7
    I get the same problem in Rider. Always with TextMeshProUGUI and TMP. Rider's analysis complains "Cannot resolve symbol 'TMPro'" and similar for TextMeshProUGUI. But there is no error in Unity. Every time, I end up doing some combination of the following and it normally goes away:

    1. Rider > Disable Solution Wide Analysis, Close Rider, Open Rider, Rider > Enable Solution Wide Analysis.
    2. Rider > Clean Solution, Rider > Build Solution
    3. Rider > Open some scripts not currently open where there reference to TextMeshProUGUI or import TMPro
    Not sure which of these steps fixes it, and not sure why this happens. Really annoying.
     
  10. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    178
    Hello,

    I'm having the same issues with 2d lights. I guess it makes kinda sense because it's still experimental in Unity 2020 but there has to be a way for Rider to still detect it?
     
  11. Alejandro-Martinez-Chacin

    Alejandro-Martinez-Chacin

    Joined:
    Oct 15, 2013
    Posts:
    144
    I'm currently using Rider 2020.3.4
    Wanted to mention that a lot of the errors on my side happened when I upgraded the Unity packages for JetBrains Rider to 3.0.7.
    Reverting back to 3.0.6 (or forcing it on the packages.json of Unity) will get rid of the errors.

    Didn't try to do Clean solution like @ColdPixel suggested though.
     
  12. SpaceCadet

    SpaceCadet

    Joined:
    Jul 29, 2013
    Posts:
    16
    • Close Unity and Unity Hub;
    • Delete all the project (.csproj) and solution (.sln) files;
    • Open your Unity project;

    Solved the issue for me (for now). This is the second time in 2 days this has happened.

    How do you upgrade / revert the Unity Packages that Rider uses, I couldn't find those settings within Rider anywhere?
     
  13. Alejandro-Martinez-Chacin

    Alejandro-Martinez-Chacin

    Joined:
    Oct 15, 2013
    Posts:
    144
    That's on the Unity Packages Manager itself, you would have to go to the manifest and packages.json and force a number there.
    But fyi, on a recently new project that I started I have updated to Unity 2021.1.14f1 and latest Rider version and it's working fine:
    upload_2021-7-14_9-55-54.png
     
    SpaceCadet likes this.
  14. glolutphoenix

    glolutphoenix

    Joined:
    May 9, 2022
    Posts:
    3
    Thanks you for this. I was running into same problem when I tried to pull my project from git.
     
  15. styGGx

    styGGx

    Joined:
    Aug 27, 2017
    Posts:
    19
    This also worked for me, thanks :)
     
  16. lemapp

    lemapp

    Joined:
    Mar 30, 2020
    Posts:
    32
    I've tried the various suggestions and it still fails for me. (Rider 2022.1.2/ Unity Editor 2021.3.5f1 LTS [Silicon]/ TextMeshPro Package 3.0.60 ) I have had other namespaces unresolved on other projects.
     
  17. Dahaka444

    Dahaka444

    Joined:
    Jun 15, 2021
    Posts:
    13
    I have teh same issue as lemapp, with the exact configurations. For me, basic symbols like void or float are red and "Cannot resolve". I've tried all of the solutions posted above without success.

    Note: I've just upgraded from 2020.3.11f1 to 2021.3.5f1 and only now encounter this error
     
  18. danila290396

    danila290396

    Joined:
    Aug 23, 2018
    Posts:
    7
    Hello. I have not Rider, but VS2019 with Resharper and I had the same issue ("Cannot resolve symbol 'color' " in TextMeshPro)
    In my case the following steps solved problem:
    1) Close Visual Studio;
    2) In Unity: Edit -> Preferences -> External Tools -> Regenerate project files
    3) Open Visual Studio.
    It may be obvious advice, but maybe it'll help someone
     
    gonzolot likes this.
  19. danineuss

    danineuss

    Joined:
    Jul 4, 2022
    Posts:
    3
    Same issue here. I tried all the cache clearing measures mentioned in the comments above but still experiencing the issue.

    Rider: 2022.2.3, Unity: 2021.3.5f209

    One thing that may be relevant: the package in question (NaughtyAttributes) that can't be referenced seems to be the only one that is displayed differently in the project folder view (with a git symbol):
    upload_2022-11-8_10-28-29.png

    I also integrate it into the project through the Package Manager, but maybe this can be a lead.
     
  20. wjlpld

    wjlpld

    Joined:
    Oct 12, 2021
    Posts:
    1
    It works! Thank you! Solved my problems
     
  21. evshiron

    evshiron

    Joined:
    Apr 10, 2022
    Posts:
    2
  22. Stk-BossLiu

    Stk-BossLiu

    Joined:
    Dec 27, 2018
    Posts:
    1
    I had tried this solutions, but it still not work.:(
    upload_2023-5-16_15-9-36.png
     
  23. kilo32

    kilo32

    Joined:
    Nov 28, 2012
    Posts:
    1
    Had a similar issue today with cannot resolve symbol.... did above and reinstalled the hub followed by an uninstall and reinstall of the rider package, followed the advice by Rider on :
    https://rider-support.jetbrains.com...dows-Unity-Resolve-symbols-between-Assemblies
    Specifically the post by Sofia Byzova April 16th ending in :Invalidate and Restart

    I still got all the errors but this time if you wait for it to find all the lack of symbols errors (on a big project) it finally cleans up and life returns to normalo_O
     
    Last edited: May 24, 2023
  24. adeick8

    adeick8

    Joined:
    Jan 4, 2023
    Posts:
    5
    ^Sofia's post fixed mine
    upload_2023-10-26_14-21-19.png