Where is my error occuring Unity - c#

When I can run my game perfectly fine, however when it stops I get this error
!CompareApproximately (det, 1.0F, .005f)
UnityEditor.DockArea:OnGUI()
From what I've been able to find I think I would be able to fix it, however I can't find where the error is occuring. I would include code, but I'm not sure what would be relevant. Any ideas would be appreciated.

This error is unrelated to your game code. This is just a small bug within the Unity Editor's internal GUI coding. Although, I thought they had patched this particular one up with the lastest hotfix release. Ensure that you are running the latest version of Unity.

Looks like you're due for a Unity Update.

Related

All my Unity projects contain blank compilation errors (only the timestamps), preventing any projects from working or importing correctly

I really need some help. I was rearranging file locations and trying to clear up some space and somehow broke the ability for Unity to operate on my laptop. The pictures of the errors are below.
This all started when I was moving a completely functional unity project from an external SSD to my internal laptop SSD. I had to clear space for the size of the project and I must have deleted something important, but I have no clue how to tell what it is.
Error seen when opening project
Editor view after opening
Error when trying to attach a script to a GameObject
Error in editor log
Steps I've taken:
I've restarted my computer several times.
I've completely uninstalled all editor versions and the unity hub (twice), including deleting all local app data for unity, emptying the temp bin, and clearing the keys in the registry.
I've started completely new projects, checked
old ones that used to work, downloaded sample ones from unity learn
just to make doubly sure that it's not me being dumb.
My current theory is that this has to do with me clearing some data from a National Instruments folder. I'm new to programming and just read online that these drivers are needed for .NET communication, but would this be why Unity keeps failing then?
This has all taken more than a few hours and I'm struggling to fix this if anyone has any suggestions, please. I'd really appreciate any insight.
Update: I'm able to make new scripts, objects, scenes, etc. but I can't attach any script components to game objects because "the script class can't be found"
Update #2: Checking the Editor logs shows that the Tundra build is failing, and the "93 items updated" matches the 93 errors that are shown. No idea what Tundra is, but that's something to look at now!
Update #3: fairly more certain it's something to do with the .NET interactions, but I'm completely unknowledgeable about this and worried about breaking this further
Answering my own question in case another person finds this and has the same issue, but the problem wasn't .net related or anything I mentioned. I uninstalled anaconda which caused some issues with the Command Prompt, where it would close immediately after opening. Unity uses this for a number of processes, so that's what caused all the blank errors.
The solution is to delete the Microsoft Command Processor AutoRun key in the registry editor.
https://forum.unity.com/threads/unity-empty-errors-on-every-project-unity-2021-3-2f1.1279124/
Cmd crashes with exit code 1 after uninstalling anaconda

Unity Prefab Not Updating On Old Android Tablet

I have a Samsung Galaxy Tab Active 1, on the latest version of android it can handle, and just recently, after adding accessibility features that shouldn’t affect anything, the balls in my game stopped updating. I instantiate a ball, and change a few properties on it, and then for some reason I think it’s not calling the update method. There are no errors.
I’ve heard using PrefabUtility to instantiate might help, but I haven’t done that just yet. I will update if PrefabUtility works.
Any advice?
Whoops, this was due to me being a bit stupid. The main reason it was happening was because of a parsing error in some of the accesibility settings, as they were not saved correctly due to weirdness I can't wrap my head around with files in Android. TLDR: file did not save correctly, and so did not load correctly, and so data messed up, and so it errored before it could do anything.

Default references will only be applied in edit mode?

It's been a long time since I did something in unity3d but today I opened an old project of mine to build an apk-file from a game I did about a year ago. But as soon as I had opened the project I saw that every reference in my c# scripts were set to None. I can't change them back and my project doesn't work without them. Below that there is an info box which says "Default references will only be applied in edit mode". I really don't know what to do because, like I already said, I didn't worked with unity for a year and I'm not so familiar with all the things. To show you what I mean I added a screenshot below.
It would be awesome if anyone could help me. Thanks in advance.
Screenshot from the reference section in the Inspector of a c# script in Unity3d
Usually the problem get fixed if you open your project with the same version of unity you've been working with a year ago maybe earlier. At this point the damage might already be done, but do you have a back-up for your project? You can start over with that earlier unity version, it will work if you haven't work with it since.
I am considering this only a message, or hint. Once you run the application, the references are getting assigned in the inspector automatically. They even stay when stopping the application, but not after saving or after relaunching unity. Weird behavior.

Building a UWP app coded in xamarin.forms in release mode results in Internal compiler error: Specified cast is not valid

I've something really annoying happening im my code.
I've built an app in Xamarin.Forms after battling for months with the framework just to find that when I'm now done, I cannot build my app in release mode to deploy it to the Store.
The app works well in debug mode, but does not build in release mode in the UWP project. I have been struggling to find a way to build my app in release mode for 5 days. but no matter which solution I see in all the forums and the stackoverflow questions I encounter, this error won't even blink.
The error which the IDE shows when I build the app in release mode is:
Internal compiler error: Specified cast is not valid.
It does not tell me anything more than that. The IDE doesn't give me any additional error message. I have struggled for days applying solutions I find to similar to this online, but nothing works.
I have updated IDE
Updated all packages
Deleted custom renderers on the UWP project
I went through every portion of code to find where I may have made a bad cast
I tried all I could find online, but nothing works.
I usually don't ask questions on forums unless it becomes critical.
If I don't get any solution, I'll be forced to delete this project and waste the months of coding I did, and abandon Xamarin for ever and move to Flutter which has a better reputation when it comes to tooling.
First of all, please don't fume so much. We understand you are frustrated, but Caps Lock just doesn't help to make us take it more seriously. Also I know Flutter is the new "cool guy in town", but it also has its set of issues. Cross-platform development is not simple and Flutter does support only two platforms, while Xamarin.Forms have a wider reach, which is bound to bring a bit more complexity.
My first suggestion would be to change the build output more verbose in Visual Studio Options, because that could uncover the actual issue here. When it comes to release mode, the problems usually come from types which are used for reflection but the compiler does not see as used and hence throws them away. Usually these errors show up at runtime however. In your case I would suggest a few following things:
First and foremost - try to delete bin and obj folders in your project. That might help, as they sometimes get cluttered with older libraries and create conflicts.
If you have been building with a source control like Git (I hope you did), I would suggest going back to some early commits and then try to build release mode there. If the project builds, jump forward to some newer commit and try again. If it does not, try an even earlier commit. The goal of this is to pinpoint when in time was the error introduced, which should significantly help you in searching where the problem comes from.
If you didn't use any source control - first remember to do so next time. However, this time you will have to do it "the old way". Create a new project and slowly as little code from the original project, trying to do release build at each step. Hopefully this will allow you to find the culprit code and then you will be able to fix it in the original project
You can definitely post your findings here and we will be happy to help you further - like pinpointing the actual problem in the code file once you narrow it down.
I suspect your problem is coming from auto-generated XAML, so definitely make sure to focus on the .xaml files adding them one by one.

ClickOnce & XNA issues

I essentially have a blank XNA project built using the XNA 3.1 wizard, i'm testing whether a game i make can be "installed" on another computer without having to make them install everything manually to make it work.
The only additional code in the game is:
Components.Add(new GamerServicesComponent(this));
After going through the ClickOnce publishing stage i copied it to a USB drive and attempted to run the "setup.exe" on a Windows Vista computer with no Visual C#/Studio or XNA installed.
According to the MSDN entry the ClickOnce will actually include everything necessary to make the game work on the computer, yet after the installation i get the dreaded "... has stopped working" when i try to run it.
Does anyone know how to get around this? I assumed the reason it says it can be done is because it works.
Thanks
http://msdn.microsoft.com/en-us/library/bb464156.aspx
Edit:
Just noticed that the article states that the Games for Windows - LIVE is not included in the distributable, would this mean if it was included as a component in the XNA game it would cause the crash when i attempt to run it?
When an application says "has stopped working" for no immediately apparent reason, that's usually a sign that an unhandled exception has occured. Since MSDN states that the GamerServicesComponent class is not available without the XNA Game Studio installed, that seems like the most plausible explanation.
Why is it available, then? Well, you need something to program up against; you wouldn't be able to use auto-completion and such if you didn't have the class, because VS wouldn't know what it looked like
Getting it to compile for, say, XBox 360, where I would guess that the class CAN be used, probably wouldn't work either if it didn't know anything about the class.
To address the general problem of a ClickOnce application which "has stopped working" immediately, you can get more information on your particular problem by looking in the Windows Event Viewer:
http://windows.microsoft.com/en-US/windows-vista/Open-Event-Viewer
Like Michael mentioned, this is often an unhandled exception, but this way you can see WHAT the unhandled exception was.

Categories