Unity Error Occurred While Resolving Packages And Game Mode Doesn't Work Suddenly - unity3d

I never ran into this problem before while building unity projects.
[1] Yesterday, I decided to update my unity hub to newer version, and now all of a sudden,
I keep getting this error and my packages are not loading into the editor workspace.
[2] Additionally, anytime I try and enter into game mode unity will suddenly stop and bounce me back to editor mode (never happened before). I am very lost why this is happening, and even my past projects that worked fine seem to be affected as well. Cannot run them within unity now. :(
All help is greatly appreciated!
-So far I have been just looking to make sure my unity apps are in the folder of that address - and they are, looking for direction.

It would be easier to help you if you include the exact error message in your question.
I assume it is this:
Cannot fetch authorization code. User access token is expired or invalid. You may need to sign out and sign in again. [Unknown].
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
If so, log out in Hub and log in again. This happens either when updating Unity Hub or with bigger Windows updates for me.

Related

I've recently started receiving an error, can anyone help? "Resolve of invalid GC handle. The handle is from a previous domain."

I've recently started receiving the following error whenever I enter play mode in the Unity editor.
Resolve of invalid GC handle. The handle is from a previous domain.
The resolve operation is skipped. UnityEngine.GUIUtility:ProcessEvent
(int,intptr,bool&)
This occurs every time I enter play mode, I'm not sure what I changed to cause this. The game still builds successfully without errors and I can't seem to find any issue with the game once built. It's worth mentioning that I may have noticed a slight dip in fps since I started getting the error. This is only while in play mode, not in the built player, although I might be imagining it, not sure.
I'm using version 2021.3.10f1, and recently updated from an earlier version, although have been using this version for around 2 weeks without issue.
Can anyone help?

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"

Getting started with Azure Spatial Anchors: CreateAzureAnchor() crash or taking a long time to load

I have been following this tutorial:
https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/tutorials/mr-learning-asa-02
there were some necessary configurations and steps not included in the tutorial like:
it needed an ARCameraManager error log
it needed an ARSession error log
it needed an ARAnchorManager error log
which I configured as I keep getting errors and fixing it along the way
and was able to deploy, test and follow the in-device tutorial:
Move the cube to a different location
Start Azure Session
Create Azure Anchor (creates an anchor at the location of the cube).
......
but I got stuck in #3
when I tap for create Azure button, it just crash but when I check the Debug version, it didn't actually crash cause there were no actual errors, I think it just keeps loading and/or working on the current main thread because everything disappeared when I tap the create Azure Button.
I check the codes of its corresponding function and this is it:
as you may notice it has an error, this is the actual script from the package I download, but all I had to do to fix this is add ".Result" after ".GetPointer()"
I divided the script and added logs so I can see which part is the problem:
the very last to log is: "tastInpt" which means getting the result is the problem.
is this fixable? can anyone help me get through this?
Could you provide little more info about your environment? For example, Unity version, Azure Spatial Anchors (ASA) SDK version and OS version of your HoloLens 2 device.
Are you using the matching ASA SDK for your Unity? In the tutorial you mentioned above has a link to this page: https://learn.microsoft.com/en-us/azure/spatial-anchors/how-tos/setup-unity-project?tabs=unity-package-web-ui
Some common mistakes includes the version mismatch - Unity 2019 requires ASA SDK 2.7 or above and below 2.9, and Unity 2020 requires min version of 2.9.
Was able to fix this on my own by using this:
a github repository of Azure samples. I actually don't know why this worked but the samples from Microsoft didn't. but here you go:
https://github.com/Azure/azure-spatial-anchors-samples
I just realize my fix for that error:
gameObject.GetComponent<UnityEngine.XR.WSA.WorldAnchor>().SetNativeSpatialAnchorPtr(currentCloudAnchor.LocalAnchor);
is just to comment it out since I thought this won't be necessary, because I was yet to start development and as I understand (from reading the code) that this is just for loading the anchor not creating it, but I might be wrong. but anyway It's one of the things we must fix also in order to load. or create(if this does indeed help with the create anchor feature)
again this script is from:
MRTK.HoloLens2.Unity.Tutorials.Assets.AzureSpatialAnchors.2.5.3.unitypackage

I get MDB_MAP_RESIZED error in Unity, how can I fix it?

Excuse me if this has been posted before, but I can't find a solution that works for me.
When I run a little 2D-game I'm working on in Unity I get following errors:
> Assertion failed on expression: 'm_ErrorCode == MDB_MAP_RESIZED || !HasAbortingErrors()
> Artifact meta info not present for hash 306bf9d63d75727c0b63ec8f203f76ac
> Asset database transaction committed twice!
> Assertion failed on expression: 'errors == MDB_SUCCESS || errors == MDB_NOTFOUND'
Despite that everything in the game seems to be running correctly, but the error keeps popping up.
Somebody suggested that it might have to do with the imported sprites, but all my sprites are PNG, which should be standard for Unity? Reimporting the sprites didn't seem to affect the error.
What could be causing the error? How can I identify it and fix it?
Check to make sure you have an active Licence in your Unity hub, if not sign up for one , they are free.
I've also just had this error -
saved and closed unity Editor
opened up hub checked for valid license
there was a hub update.- did that.
reopened Unity editor no more error.
May have just needed a restart after being open for 4 days - more likely the hub update wasn't telling the editor it was licenced properly.
Had this issue early into my development, I just reset my unity after saving and checked for updates in my license.

Unity3D v4.6.9 game doesn't run on iOS8 with xCode7

When we try running the game we see our splash screen and then we are getting the error Thread1:EXC_BAD_ACCESS code=1
at
il2cpp::icalls::mscorlib::System::String::RedirectToCreateString:
It happens before any of our c# code gets executed - before Awake().
It does run properly on iOS9.
We have tried it on Unity4.6.9 and on Unity4.6.9p3.
We have managed to build and run it for iOS8 only from Unity4.6.6 with xCode6.4. But we do need iOS9.
We can't find any references to this issue on the web, any help will be greatly appreciated.
xCode screen shot:
Unity Player Settings
Edited:
We have tried it from Unity5.2.3 too, no luck.
Another factor you should probably know is that before we run into the issue described above, we have edited the 'Run Debug' scheme of our product in xCode and disabled the 'GPU Frame Capture' because we had a different issue that prevented us from running our game on iOS8.
Here is the link we followed.
And here is a screen shot of our original issue:
We are really stuck here, hope you can help.
Are you sure that this Unity project is using the mscorlib.dll assembly from the Unity version of Mono? It looks like it may not be.
The RedirectToCreateString icall should never actually be executed, as the Mono mscorlib assembly used in Unity build strings via a single CreateString method. When this happens it usually means the moscorlib.dll version is out of sync with the IL2CPP runtime.
I'm not sure why this is happening, but it might be worth trying 4.6.9p3 with an empty (or simple) project to note the difference.
Its a replay for Josh Peterson, I could not replay with an image in a comment to his answer.
I was looking for the mscorlib.dll in my project but couldn't find one, so I looked in an old project and did find it. Here is an image of the file system of both projects.
Any way I don't know the origin of the file, I didn't manually played with it.
I have tried now to copy the mscorlib.dll from the old project to the new with no luck.
Any way my company decided to stop this investigation now and jump to the latest Unity 5.
Hope we will have more luck over there.
Thank you again.