I am getting this error after the editor crashes in the log files. This only happens on a hot-reload after code is compiled in VS.
I am using FObjectFinders in a constructor, but in a USTRUCT()
It is possible to restart the Editor without issue without this crash or error, and everything is loaded fine and it does display the Texture/Thumbnail in the Editor details on the object that is placed in the viewport…
I have not tried to reproduce this in a new project yet, I will do so if it will help the process…
The code base of the project was converted from 4.7, but it was line by line (or copy paste by file) and verified to work before I added this code that is crashing.
Can you provide me with the code that is related to this project? I see that you say that you’re using FObjectFinders in the constructor but in a UStruct, do you mean you’re creating a UStruct inside of you’re constructor and it is being used inside that declaration?
Basicly the FObjectFinder is being used within the constructor of the USTRUCT. Didn’t want to play around with it to much to see if this is a valid bug, but FItems was planned to be static, or at least accessible from a static get.
I tried using your code and putting FObjectFinders in to see if it would crash to no avail. I still believe it may be something to do with conversion. Could you give a new project a try and migrate your assets / code over to see if it still persists?
Regenerated the Project (just to be sure) Same Error
Created a new project, moved all source over, did a clean build, Same Error
Changed from the Locally built UE source (4.8.1) to the Binary managed by the UE4 launcher, Same error
So at this point I am at a lose… This problem is basicly just preventing me from HotReloading the editor. Currently I am building, running editor, making change, closing editor, building… etc…
Thank you for testing those various things. This tells us that the problem is in the code and that it isn’t just a conversion issue. It would be extremely helpful if you could send me your project, the new one would do if possible. If you’re uncomfortable with uploading it to the public, you can upload it to a third party site and send me a link through a private message on the forums. My username on the forums is . To reduce size, you can delete the Binaries, Content, Intermediate, and Saved folders when doing so.
If you cannot send me your project, please let me know and we’ll find out another way to proceed.
While this isn’t an answer to this problem directly (I would still like to know what has happened here to cause this crash)
I think I may have found a more elegant solution to my problem, which also seems to fix the issue with the crash, and probably (I am still unsure I could use clarification on this area) more efficient if I read the docs right:
FStringAssetReference to populate the TAssetPtr instead of searching for the reference with FObjectFinders and then it should load when it is needed instead of in each constructor, correct me if I am wrong.
So far, without any asset currently loaded into the game for play, it does seem to load in the editor correctly when viewing gamemode object in PIE play.
I was able to find the issue that is causing you to crash upon hot reloading and it is related to FObjectFinders.
In your ItemData.h file, you were using FObjectFinders to set something inside of a struct which will not work as it is meant to be used in a class’ constructor. Commenting out this code (and a few more lines to allow for it to compile) cause the crash to cease.
The only thing I find strange is that the code did run without issue from a cold start.
But it is understandable, and I was beginning to feel that was the issue, and had found TAssetPtr and FStringAssetReference, and FStreamManager along with some static singletons I have resolved this issue.
Yes, I can confirm that. I had peppered ConstructorHelpers::FObjectFinder in customs class constructors that are class variables to a UObject thinking that they were, technically, in the UIObject’s constructor. Everything compiles, starts and executes well. When hot reload does its thing, that when I get the crash.
@ For me, the crash reporter only prints part of the message stated, though. I only have “FObjectFinders can’t” without any following message after that. I had to search the Engine source with these two words to understand what happened. Any chance of checking if there is a formatting problem when the error is now reported with 4.8.3 ?
Whenever you have a message that is cut off like that, you can always find the full version at the end of the crash log itself. To find the crash log, open the directory for the project that crashed and then go to Saved > Logs and select the latest .txt file. The reason this happens is because the crash reporter, in addition to adding in the full file path name, is trying to add the assert message but runs out of space. If, for some reason, you do need to find it in the source however, shortly before the assert text, it’ll show you the file and the Line #. In this case it was: