Invalid or uninitialized OnlineSubsystem

I am trying to create a multiplayer session, but the log shows

LogScriptCore: Warning: Script Msg: CreateSession - Invalid or uninitialized OnlineSubsystem
LogScriptCore: Warning: Script Msg: CreateSession - Cannot map local player to unique net ID

and I don’t understand what is wrong. Replicating the error using the Third Person Template is successful. I have already seen the other answers that involve the *.Build.cs and the DefaultEngine.ini files, but those do not seem to be working for my project; however, maybe I just don’t understand. Anyone have any ideas?

Is your project a Blueprint project or C++? I had this issue with a UE 4.18 Blueprint project today, I solved it by generating a Visual Studio solution for my project and modifying the .Build.cs file. I noticed there are two locations you can modify the .Build.cs file - it worked for me when I added the OnlineSubsystem to PrivateDependencyModuleNames:

// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;

public class MyGame : ModuleRules
{
	public MyGame(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

		PrivateDependencyModuleNames.AddRange(new string[] {  });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		PrivateDependencyModuleNames.Add("OnlineSubsystem");

		// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
	}
}

I also modified the Editor Preferences → Multiplayer Options so that playing in Editor would create a Listen Server:

Let me know if this helps you at all