Unity gets stuck on Application.Reload when entering play mode - unity3d

I am experiencing a very annoying bug with unity where whenever I try and enter play mode, it gets stuck on Application.Reload. I get this every time i enter play mode, however it stops being stuck on Application.Reload whenever i edit/add a file to the assets (e.g. adding whitespace to a random script, saving and reentering unity) and then it enters playmode fine. How can I fix this as it is very inconvenient to edit a script every time I want to test... I have tried on 2020.3.25f1 and upgraded to 2020.3.29f1 and the problem has persisted. It is also not exclusive to one projects but experienced in all of them. Any ideas?

You can check to see if there is any place in your project path that is not in English.
I had a parent folder on my project path that was written in Chinese, then I had the same problem as you, changed it into English and never encountered it again.

Related

Unity: just keep loading infitely on "Application.Reload" every time i enter in play mode

The problem
Hi, I have been experiencing this kind of loading infitely on the window screen: "Application.Reload" since two or three days ago. This just happened spontaneously without any reason. I have been seaching for a solution, but the uniques fixes i had found are not working for me.
The unique not permanet solution that I came up is just use the Task Manager and close up Unity.
The possible fixes that I have tried:
"Just locate the project folder in the system explorer and click on properties" (This only work one time per application or maybe it just do not work.)
"You can check to see if there is any place in your project path that is not in English" (It just do not work.)
These are the fixes that I have tried.
Example of the problem
Meanwhile I am writing this question, I want to re-confirm this is a infinite load. So I open up my Unity Proyect, enter in the Play Mode and write this question.
This is the result:
https://i.stack.imgur.com/sTA48.png
Edit: the image actually shows the longest time i have been waiting. (1:48:34hs)
Thank in advance for any kind of help!
As I know, this problem persist as well in any Unity Operation, it can happen on Reload, Importing, Asset Indexer, etc. Is just a problem that doesn't affect Unity, and devs marked it as WNF (We'll Not Fix).
I have been struggling with this problem for some years now and the only solution I found was to close it from Task Manager and reopen it.

Unity erased all my progress on my project back to original state

I started a new project and after closing and reopening it the next day, all progress was gone. It didn't crash and there weren't any abnormalities. I didn't touch any files in file explorer so it's not like I could've reverted the project or something. And yes I saved, I always save. Recycling bin is empty so it wasn't deleted. So I haven't much idea what the cause could've been, or what else to put really.
But is there any explanation for what could have caused this so next time in the future I can prepare for all my progress being erased out of the blue. And is there any way I can retrieve the files back somehow too?
Using version 2020.3.2f1
Have you tried looking through temp files? Because I had this problem too a while ago and was able to retrieve the data which was hidden in the files somewhere. I had a backup and it didn't help because it didn't save to the backup obviously. I don't know why Unity still has this problem and there's not a lot of help on the internet regarding it either

Issue with errors in Unity on launch

I am having an issue in Unity where every time I launch the editor it asks me to enter in safe mode because there are a lot of errors and when I press ignore it launches and I can see in the console a lot of errors with the UI and I found out that I cant create UI elements directly in the hierarchy. I tried to update from 2020.3.13f1 to 2020.3.14f1 and for the first launch everything was fine, with no errors, and I could create UI elements but then when I restarted to make sure everything was actually fine, all the errors popped up again and I cant create UI. Why does this happen and does anyone have a fix because I can't find it anywhere online.
Try not to enter Safe Mode. Enter the editable project. There go to Assets-Reimport All.
It did it to me too, it's probably a Unity bug, this method fixes it. Practically it reimports the whole project by itself, avoiding that the bug gives you problems (such as those like UnityEngine.UI does not exist or Monobehavior does not exist, etc.)
Obviously you will not lose any assets and everything will be fine as before receiving the errors.
Have this issue with any template 2020+ versions
Always shows 2 empty errors on console at first run ,even on an empty project
Will try to install 2019 and hopefully work again
in my case some side app ran caused some error in the installation of Unity.
Nothing amid aboves helped.
Thus I decided to fully reinstall it from scratch to default one.
Now it worksok. But before that . To wipe out the Unity thorowly you need in:
uninstalling Unity and UnityHub in windows' settings
remove all related/remained folders in "C:\Program Files"
remove related/remained folders in "C:\Users\myname\AppData\Local "
in Register Editor go to clean unity like folders in "Computer\HKEY_CURRENT_USER\SOFTWARE"
optionally, remove sample projects in "C:\Users\myname"
You're very likely simply opening the wrong folder, it's a common mistake
Or, you have possibly moved around the folders that you cannot move
Also - it's a nuisance but it's best to install the "hub"

Unity - Can't add script behaviour CallbackExecutor [duplicate]

Yesterday I updated unity from unity5 to 2018.2.2f1. Unity scripts are not loading after Update 2018.2.2f1.
Once I try to play the Scene the scripts are not loaded and I can't add the script again it gives this error:
Can't add script component 'CubeScript' because the script class
cannot be found. Make sure that there are no compile errors and that
the file name and class name match.
If you still have the old copy of the project, upgrade the Unity project to Unity 2017 first then to 2018.2.2f1.
Here are the few possible reasons you may get this error(Ordered from very likely)
1.Script name does not match class name.
If script name is called MyClass, the class name must be MyClass. This is also case-sensitive. Double check to make sure that this is not the issue. To make sure that's not the issue, copy the class name and paste it as the script name to make sure that this is not the issue.
Note that if you have have multiple classes in one script, the class name that should match with the script name is the class that derives from MonoBehaviour.
2.There is an error in your script. Since this is an upgrade, there is a chance you're using an API that is now deprecated and removed. Open your script with Visual Studio and see if there is an error there then fix it. There is usually a red line under a code that indicates there is an error.
3.Bad import with the Unity importer and its automatic upgrade script.
Things to try:
A.The first thing to do is restart the Unity Editor.
B.Right click on the Project Tab then click "Reimport All"
C.If there is still issue, the only left is deleting the problematic script and creating a new one. There is an easier way to do this if the script is attached to many GameObjects in your scene.
A.Open the script, copy its content into notepad.
B.From the Editor and on the Project tab right click on the script "CubeScript", select "Find References In Scene".
C.Unity will now only show all the GameObjects that has this script attached to them. Delete the old script. Create a new one then copy the content from the notepad to this new script. Now, you can just drag the new script to all the filtered GameObject in the scene. Do this for every script effected. This is a manual work but should fix your issues when completed.
Here, is some reason why that's heaping.
1. Your Script Name And your class name isn't same.
2. May be there is an error in your script.
Here, is the few way to resolve it.
1. Make a same name of script and class in to this script.
2. find there is the error? and try to resolve it.
Posting here for historic purposes and if someone from Google ends up here, I strictly had the same problem (I'm on Windows 10) and here's how I fixed it :
If you click on the Console, you should see a blank error. Don't worry, it's a Editor bug, and you can see the Editor Log by selecting the console's window dropdown and selecting Open Editor Log.
For me, the problem was that "Tools\Roslyn\csc" could not be found, something that Unity uses to compile C# files.
I opened C:\Program Files\Unity\Hub\Editor\2019.2.14f1\Editor\Data\Tools\RoslynScripts\unity_csc.bat and I added ".exe" to the line "%APPLICATION_CONTENTS%\Tools\Roslyn\csc" /shared %*
(This line should now be : "%APPLICATION_CONTENTS%\Tools\Roslyn\csc.exe" /shared %*)
Now it works perfectly.
I'm completely new to Unity and game development, but I found that making the error true by entering an incorrect name, then entering the right one seems to "trick" Unity into fixing its error.
I had the same error show up but for different reasons (in case someone ends up here from google).
I was a beginner and named my file with a space in it. I got the same error after that. Make sure to NOT include spaces in your C# script.
One more thing which might help apart from other answers
Make the class which inherits from the MonoBehaviour the first class in the file. It fixed this issue for me.
Checking the console bugs and fix them is a good way to solve the problems "Can't add script component because the script class cannot be found?", although the bug seems to be irrelevant.
This works for me when I fix a bug in the other script.
for me I found out it was a script that I wasn't using which was linked to the player and other scripts that I deleted.
For me, the problem was that there was an error in another script.
Once I fixed the error, I could FINALLY attach my other scripts onto my gameobjects.
I just had this issue where I had a perfect script, no errors, and the same name as it should be but no matter what it wouldn't let me add it to a gameObject.
There was another script that was completely unrelated but it had an error in that and somehow that prevented me from adding my good new script.
Like some folks already posted here - the issue might be of a different code.
I was trying to add a script that was referenced by another one which had errors - it doesn't tell you that is the reason, although visual studio kinda suggests it by showing you the errors in the open script.
Just delete the bigger (errored) script and start adding to the unity project from the basic ones.
I had this issue where I had a good script, no errors, good name, restarting unity, following a tutorial exactly but still had this issue.
The way I fixed this is just deleting this buggy script file and creating it again. It fixed my problem perfectly! Now I could add the script to my game object with no such errors!
Hope this helps you! Cheers!

Flash not running debugger any more. Possible socket issue in Windows-10?

Bounty Update
I am leaving the question essentially the same, but I just want to point out at the beginning here that I'm most interested in help trying to get the socket between flash (Adobe Animate) and the native debugger working again, as I believe that is the issue I'm having. Or is it a socket between flash and Windows?
Original Question
I've apparently turned something off? Even when I write really bad code (like trying to call a function that isn't there or divide an integer into a fraction), the flash player boots, shows a background color and stops there. No messages in the output window or compiler errors window. If I fix my code, it all runs fine, but for about 30 minutes (ever since I started trying to work with bitmaps for a sprite sheet) I get no runtime errors no matter what kind of mistake I type in my code. Anyone know how to turn it back on?
I've checked my actionscript settings and I have both warning mode and strict mode checked on.
Could it be a socket issue? I admit I have little to no experience working with sockets and only a surface understanding of what that even means. I've added the socket tag. If someone can see that this is clearly nothing to do with sockets, by all means, I'll remove the tag.
UPDATE: 6/22/16
I just reinstalled Adobe Animate CC 2015.2 and no change. I'll try compiling it in flash builder when I get a chance to help pigeon hole the problem. (Edit 6/24: flash builder worked! But my trial version expired the next day so is no longer a viable option).
And I just tried something in the command prompt in Windows 10 as an administrator:
netsh winsock reset catalog
netsh int ip reset reset.log hit
which I found another user on flashdevelop.org used to fix a similar issue, but no change.
And I just tried debugging in Flash Builder. It worked fine (debugger caught bugs) but my trial version expired the next day.
update 6/24
I've tried launching debugger for AIR from within the Adobe Animate CC IDE and it works fine if there are no bugs; it fails to do anything visible (no Iphone emulator, no swf window) if I put a typo or error in the code.
I also just deleted winsock and winsock2, rebooted Windows, then reinstalled winsock and winsock2. No change.
update 6/25
Just tried a system restore in Windows to set all my files and settings and drivers etc. to the way it was a week and a half ago... Also completely uninstalled all Adobe products and reinstalled. No change. I can only imagine that wiping my hard drive and reinstalling Windows would do the trick, but come on, it hasn't come to that has it?
As VC.One suggested, I checked the compile error window (cannot believe I didn't check before! Maybe when I checked before there were no compile errors... Only runtime errors?) and the errors are showing up there. Does this mean that it's catching compile errors but just not runtime errors?
When you force/test a runtime error... make sure you check
Compiler Errors (ALT+F2) and also Output (F2). By Output I mean the window that shows traces (and runtime issues). One of those two should have some feedback for you.
A possible solution is to save a new Workspace. So with those windows for Compiler Errors and Output both open (or tabbed, I tab them next to my Timeline) go to Window (in top options like File/Edit/Debug etc) and choose Workspace, then into that you choose New Workspace. Give it a name in the pop-up and okay everything.
Flash should always load that current workspace (next time, go to Workspace option again, check that your specified workspace [by name] has a tick next to it...).
Possible pitfalls:
1 - Use the debug player
2 - Make sure there isn't somewhere a try/catch enclosing the portion of code that triggers the event that may lead to an error
3 - Socket issue: may be exported in debug mode but swf cannot connect to debugger (it waits in a blank state for 60 seconds I guess)
4 - Does it compile ok? If there are compilation errors you may get an SWF anyway but then it will not start
...