Plugin Causes Crash On Load

LogWindows:Error: appError called: Objects have the same fully qualified name but different paths.
New Object: Sagittarius /Script/SagittariusPlugin.Default__Sagittarius
Existing Object: Sagittarius /Script/SagittariusPlugin.Default__Sagittarius

This causes the editor to crash on load every time.

What’s odd is, I have simply copied my previously working code base from the beta into UE4. It compiles fine, but this issue crops up after I have enabled the plugin. Once I enable the plugin and restart the editor, it crashes, and continues to crash every time after that.

Has anything changed in the plugin system? What is a good fix for this issue?

Hi Willy,

I’m not aware of any changes that would cause that error; could you post a call stack for the crash? The underlying code is warning that the path matches but the types do not (e.g., it’s trying to create a new object on top of an existing object).

Do you by any chance have two different Sagittarius classes?

Cheers,
Noland

Thank you for your response!

Sorry, I cannot post a call stack, that is the extent of the information I have besides the dump file. There used to be a human-readable dump file saved in \Saved\Logs upon crash but it seems like that’s no more.

I don’t have two Sagittarius classes, but I did have to copy UE4Editor-SagittariusPlugin.dll from the plugin \Binaries\Win64 directory to the project \Binaries\Win64 directory. If I don’t do this and try to launch the editor, it cannot find the plugin DLL (even after enabling it).

Hi willyg302,

Are you still experiencing this problem? If so please let us know so we can continue to assist you. Thank you and have a great day!

Hi Willyg302,

We have not heard from you in quite some time. I am going to mark this as answered for tracking purposes. If you still need assistance please comment here so we can continue to provide support. Thank you!

Hi, sorry about the late reply. I have not been able to resolve this issue, but as it seems that I am the only one experiencing it, it would be better to focus your attention on other bugs.

I have decided to move my project away from a plugin for now. Thank you for your assistance!

Hello, I have the same problem.
I created new class in my plugin, derived from AHUD.
And in constructor of game mode I do:
HUDClass = ASomeGUIHUD::StaticClass();
After starting an Editor, and get same crash: “Objects have the same fully qualified name but different paths”…
callstack screenshot:

6739-assert_screenshot.png

Parameter InName is: Default__SomeGUIHUD
Full text of error message is:
Objects have the same fully qualified name but different paths.
New Object: SomeGUIHUD /Script/SomeGUI.Default__NoesisGUIHUD
Existing Object: SomeGUIHUD /Script/SomeGUI.Default__NoesisGUIHUD

Guys,
I found the problem.
So GENERATE_UCLASS_BODY is in a header file, so all inline functions inside this macro can have own static variables.
Problem seems in this function:

#define IMPLEMENT_CLASS(TClass) \
	static UClass* AutoInitialize##TClass = TClass::StaticClass(); \
	UClass* TClass::GetPrivateStaticClass(const TCHAR* Package) \
	{ \

		static UClass* PrivateStaticClass = NULL; // <-- HERE !!! DLL and Game module have different instances...
		if (!PrivateStaticClass)


		{ \
			/* this could be handled with templates, but we want it external to avoid code bloat */ \
			GetPrivateStaticClassBody<TClass>( \
				Package, \
				(TCHAR*)TEXT(#TClass) + 1 + ((StaticClassFlags & CLASS_Deprecated) ? 11 : 0), \
				PrivateStaticClass, \
				StaticRegisterNatives##TClass \
			); \
		} \
		return PrivateStaticClass; \
	}

Solution can be:
Do not use: ::StaticClass() in the Game module, but declare own wrapper that implemented in DLL.
For example (in CPP of a plugin I implemented next function):

UClass * ASomeGUIHUD::GetStaticModuleInstance()
{
	return ASomeGUIHUD::StaticClass();
}

Did you try adding YOURMODULE_API to the class you’re trying to instantiate?

Generally I’d use interfaces instead of accessing module specific classes directly, especially with plugins. Also make sure you’re not trying to create the instance before the module has actually been initialized and registered.

Yes, I used MYMODULE_API - in other case I get unresolved external link time error.
I not directly instantiate the class - instead I use function ::StaticClass() - that was used in FPS project templateof, where GameMode specified own HUD.

My fix that I’ve described - works.
Now I know that if something crashing with Plugins or DLL modules - then it can be related to static variables in macroses :wink:
And by maximum avoid using of static variables when work with UE4 :slight_smile:

So you can perform some refactoring if you have time.
And close the ticket :wink: