Search Unity

Clicking on Debug.Log console output doesn't me to the corresponding source code line

Discussion in 'Scripting' started by TokyoDan2, Jun 9, 2014.

  1. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    @BroVodo I had the problem with completely newly installed Unity 4.5.x and newly created projects...on Mavericks,
     
  2. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Hi guys, I've had the same problem since 4.5 or so, months now. Double clicking will open the file in mono but not go to the line number and will not open the entire solution, just that one CS file. I am on Mavericks, latest Unity and monodevelop. I've tried removing any files related to Unity/monodevelop (prefs, etc..) and reinstalling from scratch, but nothing has worked.
     
  3. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I gave up and installed Mountain Lion and Unity on an external firewire drive which I boot from when I want to get some work done. Lately Unity is more concerned in being the Jack of all Trades (supporting every platform under the sun) rather than being the master of anything. And the founders are looking to sell, hmmm....

    Since the price has come so far down UE4 is looking better and better
     
  4. Mishaps

    Mishaps

    Joined:
    Nov 28, 2011
    Posts:
    181
    script editor they ship with unity on osx has been useless since mavericks came out a year ago. Pretty glaring omission if you ask me! Just use xamarin I guess...
     
  5. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    read my earlier posts about xamarin editor. I tried it and it was so sluggish.
     
  6. Mishaps

    Mishaps

    Joined:
    Nov 28, 2011
    Posts:
    181
    xam is little slower than monodev but at least it works. Whatevs floats ur boat I guess.
     
  7. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    It wasn't a little slower. It was nearly unusable. Not a ' float ur boat' kind of situation. If it had been usable I would have used it rather than having to boot from an external disk everytime I wanted to do some development.
     
  8. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I am so sick of this MonoDevelop problem. When are Unity's engineers going to fix this goddamed issue!​
     
  9. Mishaps

    Mishaps

    Joined:
    Nov 28, 2011
    Posts:
    181
    xamarin works fine, albeit overall slightly slower than monodev. It has some issues forgetting the project or whenever you make/delete a new script in unity or quit/re-open unity. This results in it being really really slow - perhaps you are experiencing this?
    To fix it just quit xam then in unity go to the assets menu and select "Sync MonoDevelop Project". This will open xam and all the syntax highlighting should appear after a brief delay. This fixes it every time for me.
    EDIT: grammar
     
    Last edited: Sep 25, 2014
  10. raynaldo

    raynaldo

    Joined:
    Oct 7, 2013
    Posts:
    15
    I've also had this problem since 4.5 (from 4.3) on Win8.
    Logs on console (normal, warning, error, exception) can't be clicked at runtime, i.e. they don't highlight any code when clicked.
    But all logs that comes from editor is clickable & highlights the code properly.
     
  11. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,145
    Same issue for me. Console messages do not appended with "filename:linenumber" anymore. Hence the double-click on them do nothing. I cant work like this.
    Had this issue a week or two ago, and now it came back.

    Windows 8.1, Unity 4.5.3 free.

    UPD. I setted external editor to mono, disabled "editor attaching option", rebooted pc and problem has gone. But this is very strange.
     
    Last edited: Sep 24, 2014
  12. Mishaps

    Mishaps

    Joined:
    Nov 28, 2011
    Posts:
    181
    If I was on windows I'd be using visual studio! Wish we had that on mac :(
     
  13. ZannaU

    ZannaU

    Joined:
    Mar 24, 2013
    Posts:
    17
    Same problem here. It used to work fine until a week a go or so.
    Not sure what changed but now it's happening 100% of the time, pretty annoying.

    Unity 4.5.3f3
    Monodevelop 4.0.1
    OSX 10.9.4
     
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Thanks for all of the information about this problem. Thus far, it has been difficult for us to reproduce locally so we don't have a fix ready yet. I have been communicating with @TokyoDan about this via his bug report for the past week or so. I wanted to open things up to a wider audience though in hopes that we can get more data about this problem.

    First, I'll clarify what might be happening in this case.

    A few posts here reference problems on Windows. I suspect those are related to a different problem. If you are experiencing a similar problem using Windows, please have a look at the Editor.log file. A month or so ago I fixed a few problems in this code and added some logging to track down remaining issues. See the following two pages for more details:

    http://issuetracker.unity3d.com/issues/double-clicking-a-c-number-script-will-open-monodevelop-instead-of-visual-studio
    http://forum.unity3d.com/threads/double-clicking-a-c-script-should-open-visual-studio.251358/

    The code in the Unity editor for Windows and OSX is different here, so the problem in this case is probably specific to OSX. During the process of opening MonoDevelop, Unity is using Apple Events to communicate from the Unity process to the MonoDevelop process. If something during that communication goes wrong, Unity falls back to the OS-defined editor for the script file type (e.g. .cs). When that happens, Unity does not know which editor will open the file, so it cannot provide information about which line number to use. We're not sure where the communication via Apple Events is failing though.

    Second, I'll ask for help.

    Beginning in the next 4.5.4 patch release (4.5.4p3) we will have additional logging specific to the OSX code used to launch MonoDevelop. If anyone is experiencing this problem and is willing to help, please try 4.5.4p3 (or later) when it is available and have a look at the Editor.log file when the problem occurs. Any information you can provide will be greatly appreciated. Please respond on this thread or submit a bug if you can reproduce this issue on OSX with the latest patch release.

    Third, I'll talk about what might coming in the future.

    We realize that bugs like this are extremely annoying and hurt your workflows. We are currently communicating with code editors via some older technologies like COM and Apple Events, which leads to problems like this that we cannot easily reproduce and debug. We are actively working on better integration with code editors, which will also alleviate these type of issues, we are currently hard at work on those, but have no estimates on when it will be available.

    Thanks all for your information on this thread, please keep the bug reports coming in!
     
  15. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    I'm experiencing the issue and get this error (4.6b20):

    EditorHelper: Unable to use the internal script editor /Applications/Unity 4.6b20/MonoDevelop.app. Trying the default system editor now.

    The file opens in sublime text (default editor). This happens whether MonoDevelop is open or not.
     
  16. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @any_user Is MonoDevelop installed in the location mentioned in the message (/Applications/Unity 4.6b20/MonoDevelop.app)? If so, then you may indeed to reproducing the issue I'm trying to catch.

    Unfortunately, 4.6b20 does not have my logging changes, so we'll need to wait until 4.5.4p3 to get more details.
     
  17. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    yes, it's installed there. I'll try it with 4.5.4p3 as soon it is available.
     
  18. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Great! Can't wait for 4.5.4.p2
     
  19. Mishaps

    Mishaps

    Joined:
    Nov 28, 2011
    Posts:
    181
    @JoshPeterson thanks for the update! Really looking forward to the script editor issues on OSX being solved!
     
  20. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
  21. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Great! Downloading now. You'll have a log within the hour.
     
  22. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    Ok, that's what's happening:

    EditorHelper: Attempting to open file: /Volumes/Data/Library/Unity/bug reports/test/Assets/Test.cs.
    EditorHelper: Attempting to open file (using Apple events): /Volumes/Data/Library/Unity/bug reports/test/test.sln.
    EditorHelper: Failed to open file: unable to get process descriptor for /Applications/Unity 4.5/MonoDevelop.app.
    EditorHelper: Attempting to open file (using Apple events): /Volumes/Data/Library/Unity/bug reports/test/Assets/Test.cs.
    EditorHelper: Failed to open file: unable to get process descriptor for /Applications/Unity 4.5/MonoDevelop.app.
    EditorHelper: Unable to use the internal script editor /Applications/Unity 4.5/MonoDevelop.app. Trying the default system editor now.
     
  23. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Here are my logs with explanation of what I did:
     

    Attached Files:

  24. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Also here are the diffs between the two Editor.logs: (right side is on Mavericks)
     

    Attached Files:

  25. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @TokyoDan @any_user Excellent, thanks both to of you! It looks like we are seeing the same error in both cases.

    @any_user: Are you on Mavericks as well?

    I'll see if I can track down the cause now. At least it is clear which API call is failing.

    If anyone else it experiencing this problem and is willing to contribute your log file, please do so! We can always use more data for a problem like this.
     
  26. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    Yes, I'm on mavericks.
     
  27. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Happy hunting Josh.
     
  28. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Excellent, thanks for the additional information.
     
  29. mozzer7

    mozzer7

    Joined:
    May 18, 2013
    Posts:
    12
    Hey guys,

    having a similar issue, and one that has come up now and again.
    It may have already been mentioned, apologies if it has, but didn't pick it up when looking through the other posts.

    Moved project from one machine to another, and the project path still points to the old path, rather than the new one. So when double clicking on the console log, it can't find the file.

    In the past I've been able to do a re-import all to fix the issue, but it's not helping for this particular project. It always points towards the old path.

    The original path was Documents/Game Dev/Local/PROJECT ROOT

    The only way I could get to fix this was to remove the spacing in the 'Game Dev' folder name, which is the sensible thing to do. When opening the project, it still pointed to the old path, but then a quick reimport fixed it.

    Apologies if something like this was already mentioned, but just wanted to give my update on a similar issue.
     
  30. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    There are no spaces in my project path.
     
  31. mozzer7

    mozzer7

    Joined:
    May 18, 2013
    Posts:
    12
    It was unlikely that it would be the exact same thing for you. As far as I understand it, you're having it with new projects, too? As ever with this sort of thing, it's rarely because of one specific thing.

    Does the debug log show the path to the file and line number? When I was having issues it would show the full path, rather than a project relative path (Assets/Scripts/) as it does when it's working fine...
     
  32. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @mozzer7 This does sound like a different issue from the ones others are experiencing. I've not seen it come up before though. Could you submit a bug for this issue, with the example project? We can have a look at it then, thanks.
     
  33. Mishaps

    Mishaps

    Joined:
    Nov 28, 2011
    Posts:
    181
    script-editor issues appear to be resolved on OS X Yosemite with the latest unity patch 4.5.5p1. Thank you Unity! :)
     
  34. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Thanks, I'm glad you were able to verify this.

    Thanks also to @any_user and @TokyoDan for their efforts to help me correct this problem. Without them, this would still be a bug.

    Please add a comment here if you are still experiencing similar problems. However it looks like this specific problem has been corrected.
     
  35. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    Interestingly, after installing Yosemite today, the bug doesn't occur anymore in 4.6 (which doesn't include the fix yet)...
     
  36. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Maybe I'll add some details about what is happening and that will shed some light on why the behavior seems to be different for different versions of OSX (and even different machines on the same version).

    Internally, we're calling GetProcessBundleLocation to get the path to the MonoDevelop process bundle. We expect this to be something like (depending on the installation path):

    /Applications/Unity/MonoDevelop.app

    In cases there this problem occurs, we are instead getting this bundle location back:

    /Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/2.10.11/bin/mono

    The second location is the path to the Mono process use is used to run MonoDevelop. So the fix for this problem I have implemented is to do a more permissive match. Instead of requiring a specific match to the bundle location, we can also accept a "starts-with" match.

    I am unsure why we get a different bundle location on specific versions of OSX or even on different machines with the same version. So it is possible that an upgrade to Yosemite changed how GetProcessBundleLocation returned the information, and made 4.6 start working.
     
  37. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Hey everybody. Thanks to Josh this problem is finally fixed. Monodevelop now works perfectly with Unity on Mavericks! Thanks a million Josh.
     
  38. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    Unfortunately I have to revive this thread, because something again doesn't work anymore about double-clicking console output. Now (since 5.4?), printed console output created by calling print() from a monobehaviour doesn't open the script editor (MonoDevelop in my case) or jump to the line. When I double-click on an entry, nothing happens. A workaround is to use Debug.Log(), where it works perfectly fine, but it would be nice to have this fixed anyway.

    Submitted a bug report here: 856020
     
  39. John-Citizen

    John-Citizen

    Joined:
    Nov 5, 2013
    Posts:
    11
    I'm having the same issue with double clicking entries in the console. Debug.Log doesn't allow double clicking, but errors thrown by Unity do. Using OSX El Capitan.
     
  40. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    For me, it started working again in 5.5, maybe try if updating solves it for you too?
     
  41. vincent-savysoda

    vincent-savysoda

    Joined:
    Dec 19, 2016
    Posts:
    33
    I'm also having a similar issue though not sure why this happened. Basically all I did was switch the external script editor selection from "internal" to "MonoDevelop(built-in)", and now it stops sending the source code line and double-click returns on any Debug messages.(Error logs still work fine) In addition, I am now also unable to switch back the selection to "internal", so I can't revert my changes either.
     
  42. julianwitte

    julianwitte

    Joined:
    Oct 3, 2012
    Posts:
    12
    For anyone still having similar problem, I would suggest checking if Stack Trace Logging (from top right options in console tab) for Log and Warning is set to None, default is Script Only.

    It started happening to a colleague of mine, and he found it. We have no idea when or how it changed.
     
  43. vincent-savysoda

    vincent-savysoda

    Joined:
    Dec 19, 2016
    Posts:
    33
    Oh yes that was the issue. I think it was changed automatically after you change the Logging field values in the Player Settings when making a build. It somehow affected the Editor settings even though it was intended for specific device builds.
     
  44. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Pretty often clicking errors on Unity 5.5.1 doesn´t open VS here, too.

    Doesn´t help here :-(
     
  45. PS

    PS

    Joined:
    Nov 21, 2012
    Posts:
    3
    ==>
    * Removing Space from project path and project name
    * Reimport project
    Works fine..
     
  46. Kailric

    Kailric

    Joined:
    Aug 12, 2015
    Posts:
    17
    I've had this issue for a couple years now. I've check the forums before and didn't find any answers, but this time I have found at least one. The Stack Trace Logging fix worked for me for now it seems.

    I'm pretty sure my issue started because I would make a copy of the project when ever I wanted to make some radical change and then renamed that new project. This left older Microsoft Visual Studio files (and who knows what else) in the project folder each time I made a new copy.

    The only way I fixed it before was to make a Unity Package out of my whole project, then create a new project and import that package. But that was a pain and I've been to lazy to do that.

    Since I started using Collaborate I do not make copies any more.

    Anyway, when you say "Reimport" what do you mean by that? Do you mean just shutting down Unity and then reopen your project again after you have renamed the project folders? I'm going to try that at some point, but everything is working now and I don't want to break it :)
     
  47. AtifatABS

    AtifatABS

    Joined:
    Aug 6, 2019
    Posts:
    3
    If still someone is wondering...

    Thanks me later..
     

    Attached Files:

  48. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058

    here here
     
  49. partimejobnaveed

    partimejobnaveed

    Joined:
    Nov 30, 2020
    Posts:
    5
    upload_2022-7-18_18-9-19.png just check these boxes in player settings and yahoooooooooooooooooooooooooooo enjoy. Thank me later :)
     
  50. WaxyMcRivers

    WaxyMcRivers

    Joined:
    May 9, 2016
    Posts:
    59