Hi, found another bug but don’t know how to reproduce.
In Editor all works fine (with any of the PlaymodeScripts in Addressable Groups Window). As soon as I build addressables and make a build of the game it doesn’t work anymore, I attached the console to it and triggered a localizedString.GetLocalizedString() the shown error message appears in console (can’t even expand it, as soon as I click on it the console gets full grey and in the console-preview in the footer a null-ref exception occurs.)
Preload all Tables is set too, so that shouldn’t be the issue.
The addressables were misconfigured when being imported with the localization-package too as far as I can tell (not knowing to much about them), the Load/Build Paths in the generated groups were off, first I got some sort of cannot not load from remote hosting services errors, but there was no hosting service defined by default, so I changed any build-path to LocalBuildPath and any LoadPath to LocalLoadPath I guess that’s the supposed default setting?
Edit:
Looking at the TableCollection with Debug turned on seems to be correctly setup too:
It sounds like it could by due to the configuration of the addressable groups.
Can you try deleting the entire Addressables folder, then run the analyzers to regenerate the settings.
Make a backup before you do this.
After regenerating the addressable and rebuild without changing something the second error “missing shared data” no longer pops up in the console and the string is retrieved correctly now, but the former error:
WindowsPlayer(xxxxxxxxx) Should not occur! Internal logic error: please report bug. keeps poping up the first time GetLocalizedString() is called, can’t even tell form where it comes, no stacktrace information is attached, nor does it open a script when doubleclicking
Edit:
Analizers find no Issue again
May it be a problem if the Tables/Groups etc are renamed? Because I have to remove spaces and ‘-’ since paths with those symbols are ignored by our version-control automatically, and the new generated ones now have those all over the place again.
Is there maybe some place I can configure the naming pattern outside of the package-code?
What version of Unity are you using? Could you try updating to the latest patch version? I have not seen this error before, we would need a bug report so we can investigate it.
Little Update:
Okay, so I updated to 2021.1.22f1, and the Problem persists.
The I threw my debugger on it narrowing down call by call from where this ominous
“Should not occur! Internal logic error: please report bug.” Error-Message is coming from:
First in the localizedString.GetLocalizedString() call the TableReference looks like:
The 000000000… Guid looks a bit suspicious, but if it’s done like the Entry ref and only one of both name or guid has to be set fine, but m_Valid being false seems suspicious too
Debugging further shows the “Should not occur!..” Error comes somwhere in the WaitForCompletion call, which then if I have seen it correctly calls deep into the Ressource-Manager of the Addressables package. Since it doesn’t happen in Editor it seems to have to do with the addressable build-data.
Whats also strange the correct localization entry is returned after the error occurs in a development build. In a Release build the game just crashes directly on startup, even before the GetLocalizedString() is invoked, but in a development built no error occurs before ^^’
I think I will try to delete and recreate the table the error occurs with, maybe it got corrupted somehow.
Edit:
The “This should not occur”-Error only happens once the first time a GetLocalizedString() call is done, after that all works fine (in dev-built the release still crashes immediately) seems like some invalid state in the beginning?!
Those references are correct. Guid of 0 is fine as the name is set and the is valid flag just means it’s not been checked yet. Can you try disabling the wait for completion flag on the LocalizedString?
It wasn’t flagged at first, I just flagged it afterwards, it seems public string GetLocalizedString() always waits for completion.
But: I now created a new table with other test-keys and texts. if I use them in a Sequence, those work, the first time i want a key from the other table it breaks the game on first access, so I would say, the table got corrupted somehow and the analyzers don’t notice it ^^’
Either that or the cause of the Problem is, that with the erroneous table I have my custom dropdown drawer (since we use the string in a special editor which can only show one line if you don’t pup it out in a extra window.
I asked in another thread about setting those references via serialized property but cannot access the ForceUpdate() which is normally called when setting the references via the property instead of the field.
So either it needs that Update, or the last case that could lead to the error being the Reference being set as name-ref instead of guid (like the normal localizedString drawer does).
I will test which of the cases doesn’t work and leads to the error on monday, thanks for the input so far and have a nice weekend
I’ll try to decouple it from the rest of the project (it just does read from the system anyway except for the custom property drawer dropdopwn), the whole thing I can’t share sadly
I’m trying hard to make a decoupled version which behaves the same way, but for some reason the addressable assets stuff behaves kind of strange. I exported/imported all the necessary stuff via unity package. And in the new Project there are now more kind-of-the-same AssetGroups / Schemas.
The yellow squiggly-lines mean they’re ignored in our version control (due to containing ‘-’ and/or ’ '), but as you can see after importing the package in the new project on the right side there’s another “version” created which wasn’t created in the original.
Also the release build doesn’t crash with the unity-crash-popup anymore, instead it freezes and a windows “Program doesn’t respond” window pops-up when the WaitForCompletion is called. Funny enough also happens on the newly created test-table which are referenced directly to the original LocalizedString Drawer and not only to the preexisting table which were mainly referenced via the custom dropdown. But the Should-Not-Occur Error is logged to console in development build still, so I guess I just upload it as it is now. Maybe you can find out more.
Here’s the Ticket-Number: 1368759
Edit: And also happens on the strings referenced by the default LocalizedString-Drawer too in the test-project, not only on the custom-dropdown, so I guess the tables are both corrupted now (wheras I created the test-table anew in the new project), or there is some bug with building the bundles or reading from them
I think part of this error is due to the Localization importer running after the Addressables importer which creates extra groups. We have a fix for this however it will require a change to the Unity Editor. Its still being worked on.
Okay, I found the cause of this semi-“bug”.
It was related to custom-columns added to the tables, specifically I copy/pasted the sample-code from the docs since there are dependencies to some editor-assemblies I just added it to an editor-assembly of ours.
The Data-Class itself is necessary at runtime though, since the addressables-resource-manager seem to stay in this endless-loop of trying to fetch the data (or some-thing like that), if the class is not known anymore.
Moving the Data-Class to a runtime-assembly fixed the freeze, and crashes only happen with IL2CPP stripping level on high, we can build on low just fine (for now at least).
I think the docs should make more clear, that the data-class is supposed to go into a runtime-assembly, since the current example in one code-block looks like it’s fine leaving it in one script with the column-providers. Especially given, that the error is pretty hard to locate by trying to change things step-by-step and making a build each time etc.
Maybe thats something for an analyzer rule too.
I noted my findings in an e-mail answer to the former bug-report (1368759). The original report also contains a link to this forum-thread in case the notes are missing some details .
Hope it helps