Failed with Ensure error after moving from 4.17 to 4.18

I am currently having an issue which results in not being able to package the game. The error log is [here][1], as you can see, there is an error involving a ranged-for iteration that points to UE4Editor objects. I cannot figure out exactly what is causing the error, nor have I found any way to track the error down. This is what it looks like in the editor log:

I just moved from UE4.17.2 (where it worked successfully) to UE4.18.2. I have read about the changes to TArray, but the entire project is built with blueprints and visual scripting, and I would not even begin to know how to track down instances of TArray that might cause issues like this.

Any guidance would be super appreciated. We’ve been trying to sort this out for three days and have gotten nowhere.

So, after three days I gave up and made a forum post, following which I immediatley fixed the issue. Basically, I had to go through each time I referenced any array (which I found by going to the default editor window then following the menus window>find in blueprints>find in blueprints 1 then searching for “array” and going through every single result) until I found one instance of an array having “clear” called on it.

My best guess as to what happened is this: the default array class for UE4 Blueprints is the TArray class in C++. This used to be able to handle ranged-for errors on its own (which are caused by an array changing length when something is trying to loop through it). This capability was removed in 4.18 (information which I found in the C++ transition forum) and this caused my project to no longer work.

I don’t have a deep enough understanding how the Blueprint system is built to suggest a good fix, but definitley more informative error logs would be very helpful in this case. My only suggestion for people trying to avoid causing this problem is to package frequently.

In the project settings under packaging you can find some settings which make packaging far quicker (like not requiring complete re-cooks on every build) to make that less of a hassle. Other than that, I guess the Blueprint system just got slightly less intuitive in one, very very niche case with this update. Cloth physics and lighting improvements are still well worth the move!