Android can't find LAN Sessions in shipping build

My game project builds to both Android and to Windows 64-bit, and results in working apps for both.
This game app when I built using development build, enabled the Android version of the app to Find a LAN Session hosted by a Windows machine on the same WiFi network, Join it, and play against the people using the Windows version of the app.

However, after using Shipping build to build both Windows and Android versions, the Android app is not able to find any sessions when the Windows app Hosts a LAN session, anymore.

What settings do I need to change to allow shipping build to have the same LAN capabilities with cross platform play, as the development build has, so that Android players can join the game?

Could this be related to UE-62267 ?
When I added a blueprint node to expose the IP address of the host device at runtime, as a workaround for Sessions not working anymore, I found that on Windows it gave the correct IP address of the device on the LAN, but on Android, it always gives 127.0.0.1 - that can’t be right, and isn’t useful.

1 Like

Hey.
I want to connect a PC and an Android device (Oculus Quest) to the same local network.
I managed to connect a PC and a PC.
Failed to connect PC and Android device (Does not find the session).
Tell me which Online Subsystem you use?
I use the engine version 4.24.3
Thank)

1 Like

EDIT - no, it actually didn’t.

Migrating the project to 4.24 magically fixed it.

I’m using Online Subsystem Null, which is in reality not an online subsystem at all, but does handle the mechanics needed to create, find, and join sessions, just without the help of an online subsystem. In other words, it’s what you would use if you were NOT going online, but were doing only LAN (or VPN), or direct IP address known beforehand.

Online subsystems are a way of collecting and matching IP addresses up between the host and clients. Using a NULL instead of a real online subsystem means your users or the games they’re playing will know the IP address to connect to in advance, OR it will be broadcast on their local area network (by the host creating a session for them to find).

So TL;DR, I used NULL for my online subsystem.

I’m considering putting my game on Steam though, so if that’s the case, I’ll want to use the AdvancedSessions plugin and also make it able to choose either the Online subsystem or LAN, depending on what the players are trying to do.

Aaaand now it’s broken again after making the shipping build for distribution. Since I don’t know what fixed it and I don’t know what was wrong, how do I find out?
It turns out AdvancedSessionsPlugin makes the project unable to be built for Android, so I can’t add that to see if it helps.

Did you get anywhere with this, looks like the Android Socket Subsystem files were changed in early 2020?

no I havent’ gotten anywhere with it. So maybe if I downgrade back to 4.23 it will work again?

I can’t connect quests either on 4.24 with null subsystem

I saw a bug report for something similar to this but it only has 5 votes. This might be distinct enough to warrant its own Bug report.

If one of you reports it before I do, please post the bug tracking / ticket number here so the rest of us can vote it up.

Thanks for the update, keeping an eye on 4.26

This Issue seems to be the same, but on Epic’s own uproject:

Please vote it up so they’ll fix it!

Have you been able to get it working? My android device is able to find the session that is running on my computer but it always fails to join. It can’t host either. I don’t even know if it’s something I’m doing wrong with my packaging (a complete noob here)

No I haven’t got it to work. Mine still can’t find sessions on the LAN, but can join by directly opening the private LAN IP address of the host device. So I added some UI stuff to fetch and display the IP address (for the host) and input an IP address to join (on the Client devices).

You can’t host, either? That sounds like a completely different problem to this one. Do you get an error when you attempt to host, or does it just not create a session? If it doesn’t create a session, how do you know it didn’t create and that others just can’t find or join?

Make sure you added OnlineSubsystem=NULL to your DefaultEngine.ini unless you also want to use steam in which case you put Steam in there. Also make sure when you Create, Find, and Join Sessions the Use LAN bool pin is set to TRUE if you want to do it on LAN.

I’ve set it up so that it would create a session if it is unable to find any available sessions to join. However, when it doesn’t find any sessions and tries to create one, it fails (I’ve set it up so it would display an error message from the ‘On Failure’ output node). It’s able to find sessions that are hosted on my PC though, but it just keeps failing to join (Again I’ve set it to display an error message when it’s unable to join using the ‘On Failure’ output node). I did use the Advanced Session Nodes, which I’m not sure if it works with android or not, but I did try to switch back to using the normal Session Nodes months ago and from what I recall, it didn’t work either :\

In my game, I’ve made it a choice whether the player wants to play online or LAN. I’ve also added the OnlineSubsystem=NULL to the DefaultEngine.ini. This works when I’m using my PC to connect to my Laptop but it just doesn’t work with Android

I’m not sure. Before attempting to create or join a session I always destroy any current sessions the device might be using. Maybe that will help.

Oh i’ll give that a try to see if it works

But is my issue similar to yours? Isn’t it all to do with the OnlineSubsystem not working with android?

I’m not sure if it’s the same except that they’re both Android LAN related. I’m not sure if they’re caused by the same flaw though.