Packaging error 4.12p5

Getting the following error

[2016.05.30-19.38.20:730][ 0]LogWindows:Error: === Critical error: ===
Assertion failed: ModuleManager.IsModuleLoaded(ModuleName) [File:C:\Users\GeorgeDev\Documents\Unreal Projects\UnrealEngine\Engine\Source\Runtime\Core\Public\Modules\ModuleManager.h] [Line: 240]
Tried to get module interface for unloaded module: ‘OnlineSubsystem’

On 4.11.2 I am able to package perfectly fine (yes i have OnlineSubsystem in my Build.cs :P).

[here is the full package log][1]

92647-cook-2016.05.30-15.38.22.txt (20.1 KB)

Same error here in 4.12.0-preview5

This issue still seems to exist in 4.12 that just released officially, [log file here][1] .

Any suggestions on how to resolve?

92900-cook-2016.06.01-14.31.35.txt (16.4 KB)

Do you have any modification of the online subsystem?

Hey no changes to the online subsystem, why do you ask? Do you?

yes, I did some minor changes with the steam online subsystem, but I revert them and take the full github version, then this error disapear (now I’m handling some other issues with the CCD and the Physx module, so I don’t know if I solved it cause I can’t build the game)

I built full 4.12 from github but I still have the same error :-\

Hey Mentos and Davixe,

Are you all getting this error when you’re on Github only? Or does it also occur in Binary for you? What are your exact reproduction steps to get this error to happen?

Looking forward to hearing back from you, thanks!

Hey , I am getting this issue on Github and the binary.

I anticipate when ShooterGame is updated to 4.12 it will have the same packaging issue I have as it also includes the OnlineSubsystem and OnlineSubsystemUtils in its ShooterGame.build.cs which seem to be the cause of this error.

Any eta on when ShooterGame 4.12 may appear? If you could, pass a note to whoever handles that project to make sure they can package the game before releasing it!

So, I checked Shooter Game with 4.12 on binary and source. I did not have any trouble packaging. Each build has been successful. I am using the 4.11.2 version of Shooter Game and creating a COPY of the project, not converting it.

There is already a 4.12.0 version of Shooter Game out from what I can see.

Thanks!

Hey so I am able to package ShooterGame 4.12, I saw some updates to the ShooterGame.Build.cs that I thought might solve the dependency error but no luck :frowning:

I guess I will slowly migrate my project to ShooterGame 4.12 until I find the offending code/asset.

Thanks for the help !

Hey so after digging around I was able to narrow the problem down to two variables I had declared in the header file of my UUserWidget subclass:

IOnlineSubsystem* OnlineSubsystem;
IOnlineSessionPtr OnlineSessionInterface;

where I was initializing them in the constructor like so:

	OnlineSubsystem = IOnlineSubsystem::Get();
	if (OnlineSubsystem) OnlineSessionInterface = OnlineSubsystem->GetSessionInterface();

I was able to resolve this by deleting the variables from my header file and just declaring the variables in my code when I needed them:

		IOnlineSubsystem* OnlineSubsystem = IOnlineSubsystem::Get();
		IOnlineSessionPtr OnlineSessionInterface = OnlineSubsystem->GetSessionInterface();

		if (OnlineSessionInterface.IsValid())
		{
        }

Hope this may help anyone else with the same issue!

Thanks again for your time !

I’ve gone through and ensured we aren’t doing this anywhere, and we’re still experiencing this issue.

Hey so I think the cause of my package error was calling

IOnlineSubsystem::Get();

Inside of the constructor. I would say Ctrl+Shift+F in visual studio and search for any occurrences of ‘IOnlineSubsystem::Get();’ in your C++ (not the UE4 core), comment them all out and try packaging. If packaging succeeds then go back and re-enable them 1 by 1 to find the culprit

Also, share your package log here so we can review to see if it is in fact the same issue

[Cook log here][1]

93458-cook-2016.06.05-12.37.16.txt (18.1 KB)

Commented out every single usage of OnlineSubsystem from our code, except our custom OnlineSubsystem which we also disabled.

Caught between a rock and a hard place because we want the Xbox One upgrades but we can’t have a broken workflow either…

Edit: Any you also use a custom OSS? Believe to have found the cause is that we were using our custom OSS as a Plugin rather than in the Source folder.

Hmm maybe refine your search for just C++ files in your code that contain ‘OnlineSubsystem’ and see if you missed anything else.

After that I would download ShooterGame 4.12, verify that you can package the ShooterGame project (you should). Then delete ShooterGame’s Source folder and replace it with your own, build the development editor with binary 4.12. Edit the ShooterGame.uproject file with a notepad to match your game’s name in order to run the editor and try to package. Most likely this will give you the same packaging error but at least you can be certain its in your C++ and not the content. From there I would continue to remove any C++ files that reference OnlineSubsystem until your game packages

I could fix packaging with UE4.12 by changing GetModuleChecked to GetModulePtr in our custom online subsystem module code.

In the function FOnlineSubsystem****Module::StartupModule

FOnlineSubsystemModule& OSS = FModuleManager::GetModuleChecked<FOnlineSubsystemModule>("OnlineSubsystem");
OSS.RegisterPlatformService(****_SUBSYSTEM, ****Factory);

became

FOnlineSubsystemModule* OSS = FModuleManager::GetModulePtr<FOnlineSubsystemModule>("OnlineSubsystem");
if (OSS) OSS->RegisterPlatformService(****_SUBSYSTEM, ****Factory);

and in the function FOnlineSubsystem****Module::ShutdownModule

FOnlineSubsystemModule& OSS = FModuleManager::GetModuleChecked<FOnlineSubsystemModule>("OnlineSubsystem");
OSS.UnregisterPlatformService(****_SUBSYSTEM);

became

FOnlineSubsystemModule* OSS = FModuleManager::GetModulePtr<FOnlineSubsystemModule>("OnlineSubsystem");
if (OSS) OSS->UnregisterPlatformService(****_SUBSYSTEM);

I found this by checking the logs containing a crash call stack under %APPDATA%..\Local\CrashReportClient\Saved\Logs which got created there even without the crash reporter showing up during the packaging with UnrealAutomationTool.

I came here looking this up and I have the same error after migrating my project to 4.12.2. My OnlineSubsystem is my own and used to build and deploy with 4.11.x with the same source. Now I get this error.
I am using the official build, no github source.

I had same problem.
After fix my code, I can cook my game.
Thank you, .schelling.opus.