Cannot spawn blueprints in 4.7.2

Been trying to upgrade my project to 4.7.2 (source form GitHub) but am running into trouble with spawning blueprints. Things work fine in the editor, but any sort of deployment results in cryptic errors. I created a new project and copied over the minimal amount of code I needed to test things and the same problem occurs so I don’t think it’s specific to my upgraded project.

[I’ve attached the basic files needed to reproduce the problem.][2]

Start a new c++ project named TestProject, use the default options (with starter content).

Merge in the files from the zip.

Rebuild project, compile, run editor etc.

Not sure if copying the blueprints works, if it does then running the viewport in the editor and backing up should reveal a large cylinder. If it crashes the blueprints will probably need to be remade.

BridgeConstructorBP - make a basic actor blueprint, reparent it to BridgeConstructor, then place one in the world and save the map.

testCylinder - make a basic actor blueprint, reparent it to BridgeCylinder, add a unit_cylinder static mesh to the blueprint, resize the static mesh to a larger size so it’s easier to see, and save.

Once the viewport is working (it’ll crash when you exit though, as it’s missing the bit to unload the blueprints), use the Launch button to deploy to windows and after a lengthy compile it should result in the error.

Usually when upgrading you just need to right click on you “MyGame.uproject” and select “switch engine versions” that will handle a lot of the issues.

Secondly, I found just copying and paste the files into a different project wasn’t a good idea. It is better to use the migration tool built into the editor. To do that open your old project and right click and what you want copy to the new project. Right click on it and find the option migrate. It will the open up the file explorer, find the new project and select its contents folder. This will handle all pathing issues that may arise.

Hey Naremus,

I’d just like to follow up and see if Ky Mercer’s suggestions helped you out? If not, let’s work through this and see if we can get you up and running.

No, sorry. I think Ky misunderstood what I was trying to explain, or perhaps I didn’t explain well enough.

I have a project that I’ve been working on since 4.1 and have been upgrading the UE4 version as they have been released, so I am quite familiar with the general procedure of upgrading to new versions, including switching engine versions.

The code that I talked about copying was part of the project that I moved to a New 4.7.2 empty project and cleaned up in order to test if the problem was part of the upgrade process, or inherent to 4.7.2. The same error did appear, so I posted it here in case someone wanted to test it on their system and see if they also got the error (in which case it might be specific to my build of 4.7.2, which I compiled from the GitHub source).

Hey Naremus,

Sorry for the delayed response. I was able to repro and have entered this as UE-13100. Have you, by chance, tried 4.7.3? There were some conversion issues that we fixed in that hotfix.

I did try 4.7.3, I was able to get a simple example working, but converting my project more often than not results in blueprint corruption or the above error. I tried creating a new blueprint and spawning that too but it seems extremely finicky, it’ll work one time, then the next the geometry won’t appear, and then the blueprint will become corrupt somehow. It always seems to work fine in the editor though.

One note for the above procedure, for it to have any chance of working there is a config setting that must be changed (bDontLoadBlueprintOutsideEditor=false), I still get the error even after that is set properly but even simple examples won’t work without that.

Thanks Naremus,

An engineer will be able to put eyes on this now. I’m going to mark this as answered for tracking purposes.

Thanks for looking into it, let me know if you need anything else from me to attempt to debug it. I had been tinkering with it today and got a slightly different load error which I will include in case it helps:

I have a suspicion as to what may have led to this. I recall reading somewhere that the blueprint system in 4.7 was changed to better resolve circular dependencies, my hunch is that the blueprint is only partially loaded at the point the construction helper is attempting to get a reference to it. I noted running debug in the editor that the loaded objects name is “None” when the construction helper is first initialized, but if you delay retrieving the generated class until BeginPlay() the name will be initialized properly.

Due to project time constraints I gave up trying to migrate from 4.6 to 4.7. Now that 4.8 is out I’ve had a renewed interest in trying to update versions though. I’ve gotten the material loading working (had to run UMaterialInstanceDynamic::Create in BeginPlay, not the constructor) and the blueprint loading works on windows (including standalone game) but gets wonky when I deploy to Android.

If I use the blueprint directly from 4.6 it works, but the moment the blueprints get recompiled, or even if I make a new one from scratch, it fails with

D/UE4     ( 8278): Assertion failed: Export.ObjectName!=NAME_None || !(Export.ObjectFlags&RF_Public) [File:C:\Users\rwsawtel\Downloads\UnrealEngine-4.8.1\Engine\Source\Runtime\CoreUObject\Private\UObject\LinkerLoad.cpp] [Line: 3246] 

D/UE4     ( 8278): [2015.07.14-12.00.21:874][  0]Assertion failed: Assertion failed: Export.ObjectName!=NAME_None || !(Export.ObjectFlags&RF_Public) [File:C:\Users\rwsawtel\Downloads\UnrealEngine-4.8.1\Engine\Source\Runtime\CoreUObject\Private\UObject\LinkerLoad.cpp] [Line: 3246] 

I tried a new project and made a dummy example and that works though so I’m going to attempt making a clean project and migrate my source code and content into it. I’ll post an update if that solves my issues, but it’ll take a bit of work to remake all the classes/blueprints.

Hey Naremus,

Just got an update on the bug that I put in. You seemed to be on the right track with your last response and I wanted to check if you had found and solved the problem yourself.


If not, here is what our engineer noted on the bug report:

NewObject with empty name can’t be
used to create default subobjects
(inside of UObject derived class
constructor) as it produces
inconsistent object names. Use
ObjectInitializer.CreateDefaultSuobject<>
instead.

So the following line in the user’s
project:

Materials.Push(UMaterialInstanceDynamic::Create(ConstructorHelpers::FObjectFinder<UMaterial>(TEXT("MaterialInstance'/Game/StarterContent/Materials/M_Basic_Floor'")).Object, this));

Should be changed to:

Materials.Push(UMaterialInstanceDynamic::Create(ConstructorHelpers::FObjectFinder<UMaterial>(TEXT("MaterialInstance'/Game/StarterContent/Materials/M_Basic_Floor'")).Object, GetTransientPackage()));

(changed the outer of the material
instance to be the transient package
so that the instance is not a
subobject of the actor).

Alright, I await your results.

Finally got around to isolating the issue.

Long story short I was able to get 4.8.1 working by process of elimination with my code.

I’ve attach the minimum source code needed to reproduce the issue I was seeing when deploying to Android. Specifically the Shutdown function called on EndPlay is what triggers it. The blueprint that gets spawned is irrelevant, replace that with anything you like.