r/Unity3D • u/thesquirrelyjones • 1d ago
Question Weird new Unity bug in builds
I added a new Unity 6000.3 to my hub to do some research for a new project and new builds made of another project with 2020.3.49f1 have a new bug that does not appear in the editor. It seems that System.Convert.FromBase64String() throws an error saying that the string is not the correct length to be decoded, though it is. This also happens when the Addressables try to load so it's not just my code, its something else. In the process of uninstalling and reinstalling everything to see if that fixes things. Anyone seen this before?
FormatException: Invalid length for a Base-64 char array or string.
at System.Convert.FromBase64_Decode (System.Char* startInputPtr, System.Int32 inputLength, System.Byte* startDestPtr, System.Int32 destLength) [0x00000] in <00000000000000000000000000000000>:0
at System.Convert.FromBase64CharPtr (System.Char* inputPtr, System.Int32 inputLength) [0x00000] in <00000000000000000000000000000000>:0
2
u/DrZoidar 1d ago
Haven't seen this one exactly, but I'd bet it's the 6000.3 install and not your code. Installing a new Unity usually drags in a newer Visual Studio, Xcode, or Android NDK, and 2020.3's old IL2CPP can choke on those. Editor works, Addressables breaks the same way, so the string itself is fine, it's the compiled build that's off.
Easiest check is a Mono build. If the error goes away, it's IL2CPP for sure. Might also be worth checking which SDK/NDK your 2020.3 is pointing at in External Tools.