Many compilation errors after importing DOTS editor - unity3d

I'm trying to learn how to use DOTS, and I can't seem to get it to compile in a blank project.
I installed the following packages into a new unity project using editor version 2021.3.6f1:
com.unity.entities 0.51.1-preview.21
com.unity.rendering.hybrid 0.51.1-preview.21
com.unity.dots.editor 0.12.0-preview.6
Most of the (999+) compilation errors are file conflicts between the dots editor and the entities package, on top of some accessibility errors and some general other compilation errors.
One example of a conflict is:
GUID [0f14985c7cd188246a215cae5e2919a6] for asset 'Packages/com.unity.dots.editor/Runtime/Unity.InternalAPIEngineBridge.002/Unity.InternalAPIEngineBridge.002.asmdef' conflicts with: 'Packages/com.unity.entities/Unity.Entities.Editor/Unity.InternalAPIEngineBridge.002/Unity.InternalAPIEngineBridge.002.asmdef' (current owner) We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
And an example of an accessibility error is:
Library\PackageCache\com.unity.dots.editor#0.12.0-preview.6\Editor\SystemSchedule\Details\SystemDetailsVisualElement.cs(36,16): error CS0122: 'SystemTreeViewItem' is inaccessible due to its protection level
Any ideas on how to resolve this? I assume it's a package versioning issue, but I don't know what versions might be compatible

Definitely remove com.unity.dots.editor package from this list. This early dots editor tooling package became replaced by newer & built-in dots tools.
It is no longer needed since 2021.3 (I believe) and is likely to throw all kinds of errors in the newer editor versions.

Related

Unity Mirror not Importing correctly

I was following this tutorial https://www.youtube.com/watch?v=8VVgIjWBXks
about making a multiplayer game in unity using Mirror https://assetstore.unity.com/packages/tools/network/mirror-129321.
So obviously I went to the asset store and imported it... (I'm using unity 2020.1)
But now it's throwing a ton of errors and not letting me use "using Mirror;"
VSCode says: The type or namespace name 'Mirror' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]
Interestingly enough I can run the game without any issues even with all the errors but when I try in my code to "using Mirror;" it doesn't work
I tried reimporting and restarting the project, regenerating .csproj files, and even trying on different unity versions but nothing worked. I'm assuming that the Mirror package itself is totally fine but I'm doing something stupid....
Any idea what I could do?
This seems to be the problem:
Most likely the version of VS Code you have installed, reverting VS Code C# Extension from 1.23 to 1.22.
The short term fix involves literally deleting Mirror from Unity and re-importing it from the Package Manager. Also deleting *.vscode and *.SLN files.
A proper discussion about this issue is found at Omnisharp-vscode GitHub page.
I had to ensure player settings had scripting define symbols:
MIRROR
MIRROR_17_0_OR_NEWER

Unity "are you missing a using directive" on a using directive

I run into this problem every few months and it annoys the crap out of me. I do not understand what causes this or how I seem to keep fixing it. But every once and awhile I will update Unity, switch git branches or something and then all of a sudden Unity can not find packages imported from GitHub.
I can see that the libraries are in my unity packages folder but Unity can not see them. Here you can see MyBox and xNode are in my Unity Packages folder.
The funny thing about the error, highlighted below, is that the line of code it is complaining about possibly not having a using directive for xNodeEditor... is a using directive for xNodeEditor...
Here is the error I am getting for that line. "Assets\Editor\xNode\DialogueNodeEditor.cs(2,7): error CS0246: The type or namespace name 'XNodeEditor' could not be found (are you missing a using directive or an assembly reference?)"
I don't think this is a namespace issue as I don't use namespaces. I am sorry I can't provide more information I do not know what I did recently to my project before this started again.
Not sure if this is relevant but here is my GameAssembly where you can see MyBox and xNode are present.
As I stated in the comments, closing Unity before switching branches seems to help minimise how much Unity freaks out.
After, if VS is no longer recognising libraries in your code / Unity's built in scripts it may have to do with not opening the SLN file.
Here is a part of a tutorial I wrote as this problem occurred on the school computers.
If VS says "Miscellaneous Files" just under the scripts name tabs it has not properly opened the Unity files. Fix this by closing VS and opening by clicking in Unity "Assets" then "Open C# Project" it may prompt you to specify a SLN file.
Even if VS does not say the files are misc it seems to help to open via assets rather than double clicking a script.

How to fix "The type or namespace name could not be found"?

Visual studio wont recognize certain packages (Entities, and TMPro, to name a few) and it gives the error: The type or namespace name could not be found; but everything compiles fine. I know there are already many questions and answers related to this problem, but so far none of them have worked for me.
So the way I downloaded these packages was by using the Unity Package Manager, so this makes things even more confusing because I installed other packages the same way, and they are recognized no problem.
So far I have tried:
Checking the target framework of the packages and the project (all are .NET Framework 4.6)
Deleting the Library folder
Checking my Unity version (2019.2.0a11)
Some extra notes:
I've had this issue for a long time now (with TMPro to be specific; for about a year) ever since downloading it from the Package Manager in one of the 2018.X versions
In other Unity projects, which are using various versions, give the same result. This leads me to believe it is something to do with my visual studio.
The Entities package shows up on the side, see picture below
I uninstalled Visual Studio 2017 installed Visual Studio 2019 and it fixed my problem. I suspect re-installing like others suggested may have worked too.

Unity3d with Xbox Live & Mixer Interactive Plugin

I'm using Unity3d 5.6.0f3 and develop a game which uses the Xbox Live Creators Plugin and the Mixer-Interactive-Plugin.
My problem is that both uses the Newtonsoft.Json.dll in different versions, so I got the error message:
error CS1703: An assembly 'Newtonsoft.Json' with the same identity has
already been imported. Consider removing one of the references
Assets/Xbox Live/Libs/Unity/Newtonsoft.Json.dll (Location of the
symbol related to previous error)
Assets/MixerInteractive/Source/DLLs/Win32/Newtonsoft.Json.dll
(Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
Removing one of these assemblies gives an DirectoryNotFoundException in addition, but the previous mentioned error message still exists.
Is there any way to manage references or does anyone know how to fix this?
It was too easy ...
Because the Mixer Interactive Plugin is open source and no pre-compiled assembly with static dependencies, it was possible to just untick all Newtonsoft.Json-references at the import process to unity.
Thank for bringing this up. The quickest way to fix it is to delete Newtonsoft.Json.dll from one of the two plugins. Deleting it from the Xbox Live plugin is simpler (since the plugin has fewer platform checkboxes checked).
We'll see what we can do to make this better.

Eclipse #ifdef error using JNI, Android NDK and Vuforia

With Vuforia's ImageTargets sample application, I tried using OpenGL ES 1.1 by setting USE_OPENGL_ES_1_1 to true in jni/Android.mk and uncommenting and changing the corresponding line in AndroidManifest.xml (). After converting the project so that it has a C++ perspective and associating ndk-build and the proper include directories, I could successfully run the application on my Android device.
However, the problem is that once I open up jni/ImageTargets.cpp, I get several errors from Eclipse, all from places where OpenGL ES 2.0 code would execute, the first one being:
Description Resource Path Location Type Symbol 'vertexHandle' could
not be resolved ImageTargets.cpp /ImageTargets/jni line 402 Semantic
Error
Sure enough, vertexHandle is defined at the top of the ImageTargets.cpp, inside the "#ifdef USE_OPENGL_ES_2_0" block. Because USE_OPENGL_ES_2_0 is not defined (per Android.mk), the code should be able to compile successfully, and sure enough, ndk-build does not report any problems. So it seems that only Eclipse reports the problems and when I run the project, Eclipse says, "Your project contains error(s), please fix them before running your application." And thus, I cannot run my application anymore. In a sense, it's kind of strange that this never occurred until I opened ImageTargets.cpp and Eclipse "discovered" the errors.
The best work-around I've found so far is to just delete or comment out those lines (that should not be causing problems because USE_OPENGL_ES_2_0 is not supposed to be defined)... Is there a better way to deal with this problem? Did I miss a setting in Eclipse that should solve this?
I've found a solution: go to the project properties -> C/C++ Build -> Discovery Options -> Check "Automate discovery of paths and symbols"