UIS lost all TMPRO references when switching build platorm

Beor Games

New member
Hey there!

My project was initially setup for a WebGL build, and everything was working great.
I changed computer, brought my project to the new computer, and everything was still working. I changed from Windows 10 to 11, but remained with the same Unity version 2020.3.38.
When I switched the build to Desktop I noticed that my inventory wasn't updating any texts, checking what happened I found that all the TMPRO references were null. I had to set all the references again and it kept working fine.
I switched back to WebGL and everything was still working.

Now I switched the build to Android, and UIS lost all it's TMPRO references again! I had to set all again, but everything is working fine.

That's all, I hope it helps someone in the future
 
We use a custom struct for text that allows us to use both Unity default Text and TMPro. And if TMPro is not installed we have definition symbols that removes the code... I wonder if Unity has to uninstall and reinstall TMPro when switching build platform.

Unfortunatly if that's the case there is not much we can do, it would be a Unity bug.

For the future to avoid having to reset those references manually. You have two options
1) Switch to an empty scene before you make the build platform switch
2) Use version control with github or other to return your scene to the previous state (I don't think that will be a problem)
 
Top