Packaging error "Ensure condition failed: false"

LogOutputDevice: Error: Ensure condition failed: false [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 1738]
LogOutputDevice: Error: Template Mismatch during attachment. Attaching instanced component to template component. Parent ‘SkeletalMeshComponent0’ Self 'SkeletalMeshComponent0’link text

Hello there, I have the same error while trying to build the project. My error was I am trying to attach a scene component to itself. At least that was the error message. From the context class where my error lies, I have “auto SMesh = CreateDefaultSubobject(TEXT(“FPSkeletalMesh”))” and set this to be the root component on the next line: “RootComponent = SMesh”. A few lines down (without paying attention), I have SMesh->SetupAttachment(RootComponent). This is where the error is. After removed the setupattachment, the error is solved. I think somewhere in your code, you must have the same problem or similar situation. I hope this will help and good luck on your quest if you haven’t solved it already.

Someone could help me?