Unity building old version of the game - unity3d

I am trying to build my game, but unity is building old version instead, what can I do? My unity version is 2021.3.7f1, targeting WebGL. All scenes are added in the Build and there are no build errors
Here are the cases that I have tried:
Running the game via Build and Run works
All Scenes are added in the Build
No errors before and after building
I noticed that after a new build, the only changes that
occurred are in the ProjectSettings.asset file and the index.html
file

I was stuck with same error for hours!
Everything looks fine in editor, updated version of the scene, but in build without any errors a very old version is being generated.
What I tried (that did NOT work, but that has been recommended and could work):
Deleting Library and obj folder
Using different version of Unity
Testing WebGL build instead of Win build
Selecting "Clean Build" instead of "Build and run"
Duplicating scene, adding and removing it from "Scenes in Build" list
Restarting Unity/computer
What finally DID work:
I copy all content of scene and pasted it in a new scene. This worked right away, but some models/materials were missing. So I am assuming that those materials and models were silently causing some problem so I replaced them and scene was built properly once again.
Very mysterious issue!
Hope this helps!

Related

Unity 3d build failed almost at the end, but it run fine in editor why is that?

Why my unity build is failing at the last moment??? I can run the game fine in editor but it won't build the release version, does anyone know why?
I have already setup keystore and I am using default unity sdk and ndk.
you have 4 errors and you can see their solutions in the links below:
Try to solve it one after another because maybe the first problem leads to all other problems.
unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE : Solution 1
Compiling Error: Major Version 52 is newer than 51 : Solution 2
CommandInvokationFailure: Gradle build failed : Solution 3
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) : Solution 4
Hope it helps!
I noticed that having any special characters in the full path that leads to Unity project folder will crash Unity WebGL build at the end every time.
Project will run without errors in the Unity Editor, but crash constantly if there is e.g. comma in the path name.
In this case there was a path like:
Homefolder/Create with code, name/ProjectFolder
which kept crashing constantly.
Changing the path to this:
Homefolder/Create_with_code_name/ProjectFolder
solved the issue.
What is notable that the ProjectFolder itself didn't have any special characters in it but the folder that lead to this folder.

Unity + ClearScript - Importing DLL

I'm trying to use ClearScript in Unity, but fail because Unity does not see the DLL.
To be sure, I cloned the project and had the DLLs built. I did this using the instructions from ClearScript.
The goal is to use the DLL on HoloLens, which in turn means I have UWP as the platform and ARM64 as the architecture.
But I also want to have valid references during the implementation in Unity and not have constantly grayed out code because of the scripting symbols (such as UNITY_WSA).
So what did I do?
Screenshot - I took the dlls out of the output-net4.5-folder and set the api compatibility level in unity to .NET 4.x. The red ones are the dlls that I need and the blue ones only if I realy need to use V8, like already mentioned by the instruction from ClearScript.
All the dlls, except "..win-x64|86.dll", are managed dlls and should work out of the box in unity. So this are the import settings for the managed dlls and the settings for the unmanaged|native dlls.
So what did I miss or what did I do wrong? I used in the past for example another javascript interpreter, called Jint, where I also just took the managed dll out of the .net-4.5-build folder, imported it under Assets/Plugins/Jint and used it in my code just by adding the using in my classes.
I'm not sure if I should actually be happy or sad. Unity does what it feels like doing. The whole time (2 days) it didn't want to load the DLL for me. Just now I opened Unity for the 30th time and suddenly Unity recognized the DLL and listed it under references in the vs-unity-project.
So I doubted whether Unity, after making changes in Unity, actually reassembles the VS project.What did I do to confirm the guess and what do you need to do to solve the problem? I added a new DLL, this of course was not seen by unity and not referenced in the vs-unity-project. Then I deleted the solution file and the C# project file from the Unity project and restarted Unity. And when I reopened the VS Unity project (by opening a c# script), all the DLLs including the new DLL were suddenly referenced and the usings worked!

SwiftUI builds successfully but preview fails

I'm on the latest OS and Xcode version (11.2) and for some reason my canvas just will not build. I keep getting X is not a member of PROJECT error. It's driving me insane. It was working not that long ago and I have no idea what changed to make it fail like this. I've also tried deleting Derived Data, restarting laptop...
I've made sure that all my files are included in my target and everything looks like it should be working properly, the app itself builds perfectly fine it's just the preview
The solution to my problem was that I had a file within my project named the same as my project name. The error messaging was not useful at all in solving this, but once I had renamed that file, the preview began working again.
So I had this same issue except I found out it was because I have custom build configurations and it didn't like the custom module name Xcode made. The solution was to rename the module to the same thing as debug and release in Build Settings > Product Module Name
I hope this helps someone

Unity 3D is Layout Errors On a fresh install

Unity 3d doesnt work, when I try to open my project it says that This can happen if layout contains custom windows and there are compile errors in the project. I tried reinstalling OpenGL and something that I found on the internet but didn't work. The error window says that Revert Factory Settings but same thing happens after it too my Unity version is 2020.1.0a My OS is Ubuntu and I gave all the permissions to some folders. Didn't work And all this happened after a fresh install
Unity 2020.1.0a3 is an ALPHA VERSION!
As any alpha version it is not stable for production and can be expected to be full of bugs and unexpected behavior.
Search through the Known Issues in 2020.1.0a3 maybe your problem is already listed there.
In general do not touch alpha or beta versions unless you want to checkout a new added feature and test it.
For anything else stick to the stable releases like 2019.1.14f1 or 2019.2.6f1
On the last letter you can see their state:
a = Alpha
b = Beta
f = Release
Not sure if these are related but here and here also others had this problem already in early version so maybe one of their hot-fixes work for you as well.
This error may occur in released versions.
To resolve this problem:
Go to this directory:
C:\Users{YOUR_USER}\AppData\Roaming\Unity\Editor-5.x\Preferences\Layouts\default
Open Default.wlt file with Notepad or any text editor and copy all its contents.
Go to your unity project directory like this:
{YOUR_UNITY_PROJECT}\Library
Open CurrentLayout-default.dwlt file with Notepad or any text editor and delete all its contents then paste the contents of Default.wlt that you copied in step 2
If these files exist in Library delete them:
CurrentMaximizeLayout.dwlt
CurrentLayout.dwlt
Stop the Unity Hub service by a click the system tray and right-click on Unity Hub icon then select Quit Unity Hub.
Run your project again.

XCode 4 problem, always showing target view when stops at a break point

I just upgraded to XCode 4.0.2 and ran into a strange issue. Every time when the app stops at a breakpoint, XCode shows the target view instead of the .m file. When I manually click the file and show it, and click step, then the IDE switches to the target view again. This makes debugging virtually impossible. THis only happens to my own project. Sample projects work fine. Please help, it drives me nuts and I can not find where did I get the settings wrong.
P.S, this project worked fine on XCode 3, after upgrading to Xcode 4 I had problems with my targets. After wrestling a while with the schemes it finally builds and runs fine, but I can not do debugging when making changes because of this. I am not sure if I messed up some settings during the time to change the scheme and target settings.
Thanks
Ray
Ok, found the problem, but still not having the real solution. The situation is that the project was originally in one directory called WorldClock, after having problems when installed XCode 4, I copied the folder to another folder called WorldClockNew, and started in this folder. However somehow the build directory is still pointing to the old directory. After deleting the Build folder under WorldClock, this problem went away. However I still can not find where in the XCode settings to correct the Build path..