It’s been some time (over 2 years) I was working on my project in Unity version 2019, now I installed 2022.3.4f1, opened project, removed few errors and project was almost upgraded, except shaders. So there were no errors in console, but everything was “missing texture pink”. I installed HDRP from packet manager, because I was using HDRP in 2019 editor, but now I am getting
Exception: Blitter is already initialized. Please only initialize the blitter once or you will leak engine resources. If you need to re-initialize the blitter with different shaders destroy & recreate it.
exception and there is no rendering scene. I have no idea how to re-initialize blitter. Honestly migrating this project to newer version is always such mess, now upgrading it after 2 years not working on it was probably mistake. How to resolve blitter initialization exception?
Before you even consider upgrading you need to make sure the new version Unity even works.
How to troubleshoot build failures:
First, make a blank project with a single blank scene and prove that it builds successfully.
If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.
Until you can build a blank project to the target platform, don’t fiddle with anything else.
Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.
Most often things that prevent building are third-party libraries such as Firebase.
Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.
It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.
Android build not building:
Recently (circa July 2022) there have been reports of Unity’s installer failing to install the Android Tools.
Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022:
Android Gradle errors and other related stuff:
ISSUES RELATED TO UPGRADING PROJECTS (eg, changing to a higher Unity version)
Upgrading to a later version of Unity is a one-way process. Any project that has been updated should NEVER be reverted to an earlier version of Unity because this is expressly not supported by Unity. Doing so exposes your project to internal inconsistencies and breakage that may actually be impossible to repair.
If you want to upgrade to a newer version of Unity, do not even consider it until you have placed your project fully under proper source control. This goes double or triple for non-LTS (Tech Stream) versions of Unity3D, which can be extremely unstable compared with LTS.
Once you have source-controlled your project then you may attempt a Unity upgrade. Immediately after any attempted upgrade you should try to view as much of your project as possible, with a mind to looking for broken animations or materials or any other scripting errors or runtime issues.
After an upgrade you should ALWAYS build to all targets you contemplate supporting: iOS and Android can be particularly finicky, and of course any third party libraries you use must also “play nice” with the new version of Unity. Since you didn’t write the third party library, it is up to you to vet it against the new version to make sure it still works.
If there are issues in your testing after upgrading Unity, ABANDON the upgrade, revert your project in source control and be back where you were pre-upgrade with the earlier version of Unity.
Obviously the less you test after the upgrade the more chance you will have of an undiscovered critical issue.
This risk of upgrading is entirely on you and must be considered whenever you contemplate a Unity version upgrade.
Do not upgrade “just for fun” or you may become very unhappy.
PROPERLY CONFIGURING AND USING ENTERPRISE SOURCE CONTROL
I’m sorry you’ve had this issue. Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.
Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).
You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.
As far as configuring Unity to play nice with git, keep this in mind:
I usually make a separate repository for each game, but I have some repositories with a bunch of smaller test games.
Here is how I use git in one of my games, Jetpack Kurt:
Using fine-grained source control as you work to refine your engineering:
Share/Sharing source code between projects:
Setting up an appropriate .gitignore file for Unity3D:
Generally the ONLY folders you should ever source control are:
Assets/
ProjectSettings/
Packages/
NEVER source control Library/ or Temp/ or Logs/
NEVER source control anything from Visual Studio (.vs, .csproj, none of that noise)
Setting git up with Unity (includes above .gitignore concepts):
It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It’s simply ridiculous not to back up.
If you plan on joining the software industry, you will be required and expected to know how to use source control.
“Use source control or you will be really sad sooner or later.” - StarManta on the Unity3D forum boards
Thank You for your effortful answer. Unfortunately I was “forced” to upgrade unity version, because when trying to download project into original, previous version of Unity, the Asset folder did not download at all. Editor console showed up error, saying that collaborate is deprecated and I should use PlasticSCM instead. Now, the Migration Wizard doesn’t work (404 Error), so I installed newer version of Unity and managed to download my project from collab. However, second project I have in progress also won’t download into its original version of Unity with the same error.
You mention problems with building project, although, I have issues with editor itself not rendering scenes after fixing some other issues. For the second project I cannot even manage to download the Asset folder (still trying it in older version to avoid same issue).
Though, I admit my source control knowledge is poor, I had always relied on collab, now when it’s deprecated I need to set things right, because in 30 days my collab data will be erased.
Had this issue while creating a CustomPostProcessVolumeComponent (HDRP).
What triggered the error :
I had my parameters (ClampedFloatParameter, BoolParameter, and so on) public but not constructed.
Constructing them fixed the issue, the nullrefs were not targetting anything on the code, only a warning gave the lead (it should be an error, or an exception, to me).
[System.Serializable, VolumeComponentMenu("Post-processing/Custom/TiltShift")]
public sealed class TiltShift : CustomPostProcessVolumeComponent, IPostProcessComponent
{
// This generates the error :
[Tooltip("Controls the intensity of the effect.")]
public BoolParameter Enable;
public BoolParameter Preview;
public ClampedFloatParameter Offset;
// .....
}
[System.Serializable, VolumeComponentMenu("Post-processing/Custom/TiltShift")]
public sealed class TiltShift : CustomPostProcessVolumeComponent, IPostProcessComponent
{
// Fix :
[Tooltip("Controls the intensity of the effect.")]
public BoolParameter Enable = new BoolParameter(false);
public BoolParameter Preview = new BoolParameter(false);
public ClampedFloatParameter Offset = new ClampedFloatParameter(0, -1, 1);
// .....
}
It might be a good thing to add something in Troubleshooting for this as the spawned error doesn’t show what the issue actually is.
Or changing the warning to an error or exception pointing to the code at fault.
Hope that helps people using Search engines, with a similar issue ^^