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

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

Related

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

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.

Unity machine learning using internal brain for pre-trained networks results in crash

I try to get the machine learning project of Unity running. The project can be found here: https://github.com/Unity-Technologies/ml-agents
Following all the necessary steps to set everything up, everything works fine until I try to use a pre-trained model in an internal brain, e.g in the 3D-Ball example. On pressing play in the editor, it says to have stopped working and the editor crashes. Same goes for a successfully compiled executable.
Since I can't find any crash logs, I absolutely don't know what's the cause to this. Anybody had the same issue and solved it, or any ideas on this?
I'll just add the steps I made to set my project up, in case somebody wants to reproduce or check for mistakes I made:
Download zipped project from github
Open project with Unity 2018.1.1f1
Add ENABLE_TENSORFLOW to predefined symbols
Download and install TensorflowSharp Plugin
In the 3DBall Scene select the brain and switch BrainType to Internal
Run in editor or compile and run, results both times in a crash
EDIT
What's making me wonder is that I got it working just fine training an external brain in python using a compiled executable. So my thoughts were it should be much more easy to just forward pass a trained net, if it's working doing forward pass and back propagation. But it says though that external brain still is experimental, so not sure if that just will not work until some future patches.
EDIT 2
So I tried using an internal brain in an older version of the githubs project, which then worked quite fine. Also I used an older version of the TensforflowSharp Plugin. I'll try to figure out, which version still works and gonna post my results here ;)
To conclude, the problem was actually the recent version of the TensorflowSharp Plugin. Using an older version, which I found somewhere worked fine. I don't have the link to that version anymore, but in case someone experiences the exact same problem, I could search for it or upload it somewhere.

LibGit2Sharp problems

I am trying to use LibGit2Sharp in Unity 2018.2 beta, because previous versions of Unity doesn't support .NET Framework 4.7.1, which will be needed for LibGit2Sharp.
I wanted to try a few things first and came across the following problems:
if I try to clone a repository (I have used the example on GitHub first: https://github.com/libgit2/libgit2sharp/wiki/git-clone), I get an "LibGit2SharpException: failed to send request" error in Unity.
I have also tried to get information from a working copy. I create a Repository with new Repository(string path), get the RepositoryStatus from it with rep.RetrieveStatus(new StatusOptions()). Now, if I try to access the state of files, it causes a crash in Unity. No matter if I iterate through all files and want to print file.State, or want to get a specific FileStatus list from the whole status (example: status.Added). However, printing the filepaths works.
Fetching does not works either for me, it throws the same exception as the clone command.
I think the second one is maybe just an issue, but clone and fetch should work.
Update: sadly, I keep facing problems in my project with libgit2sharp in Unity. I want to make a commit, now if i try to iterate through the StatusEntries to stage the files, Unity just crashes, but sometimes it works. It is really hard to reproduce the bug, and often I get different crashlog-entries for the same process. The last time I have tried today the error was:
0x00007FFB417386CE (git2-6311e88) [c:\projects\libgit2sharp-nativebinaries\libgit2\src\diff_generate.c:1352] git_diff_tree_to_index
I have created a test-repository in my program using the Github API and cloned this to my pc, this works fine so far. And then if I create some files in the folder and want to make a commit, I run into the error above. Sadly this is one of several other issues and I can't really make progress with my project.
I have installed libgit2sharp and binaries with the Nuget Package Manager of Visual Studio.
Does anyone have experience with LibGit2Sharp and maybe some ideas of what I could be doing wrong, or why these things don't work for me?
Update 2: I'm still trying to solve the problem. I have now tested multiple times the different ways to get informations about the file-status of a repository. The best way to do it in my project would be with Repository.RetrieveStatus(filePath), now if I try this, it throws an AmbiguousSpecificationException. Can somebody explain, what does this exactly mean and how can I avoid it? I have also tried to force a literal path evaluation with Repository.RetrieveStatus(new StatusOptions() { DisablePathSpecMatch = true }); as recommended in the message of the AmbiguousSpecificationException, but then Unity crashes with the error-log in the first Update of this Post.
I had the same problem where Unity crashed on RetrieveStatus(); call. Seems like this might be a bug in LibGit2Sharp since RetrieveStatus("filepath") worked for me. I used the latest libgit2sharp commit (0dcaefc) and Unity 2018.3.0f2.
I used the absolute filepath and "\" instead of "/" (running on Windows 10).

Unity3D is unable to find jar system path after importing google play services library

Iam trying to upload a simple Unity3D test app on my Google Play Games Console. The only purpose of this is to get familiarized with the workings of this as I have just opened up my account and Iam a first timer on the subject.
I have started out with a great tutorial on implementing Google Play Services Library I found on YT. The test app was working okay except for the end part where I had problems with the built. Nevertheless I decided to redo the test app from the begining for better understanding and memorization of the procces and maybe figuring out why the build was not working as it should have been.
Before redoing everyting I upgraded Unity to 5.4.1f1. (from 5.3.3f1)
Now after I import the Google Play Services Library to the project and try to setup the Google Play Games > Setup > Android Setup, Unity is suddenly unable to find jar system path.
When I press play button I get the below error:
Error
I went through the readme file, made sure everything was done as listed (source), read through dozens of questions/answers here and on Unity Community, and I still cannot find a soultion for my problem. I made sure that the paths were correct, checked other projects and they are still working fine. So the problem starts with importation of the GPSL.
Any help would be greatly appreciated !
Solved the problem. I was not paying enough attention to the redame file on Git.
I had a set JDK variable in Users variables but instead in needed to add also JAVA_HOME variable.
Solved
To set the variable you need to go to Computer/Properties/Advanced system settings/Enviroment variables and set it there.
Do not forget to also add a PATH in the Systems variables.
Hope this helps. Cheers!

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.