in0finite/NetworkDiscoveryUnity

Android

SaschaOwl opened this issue · 3 comments

How do you make it work on android?

It is able to broadcast but not receiving any. Should there be anything done in the android manifest?

This is the warning I get
2022/07/27 10:53:08.049 11172 11172 Warn UnityMain type=1400 audit(0.0:291467): avc: denied { search } for name="net" dev="sysfs" ino=41103 scontext=u:r:untrusted_app:s0:c147,c257,c512,c768 tcontext=u:object_r:sysfs_net:s0 tclass=dir permissive=0

It works fine for me. I am not sure what the warning message means, but I do see untrusted_app in it, so maybe it's related to the way the app is installed (ie. not installed from app store).

Ok, I just remembered that the app needs to have network access allowed. This can be added in Unity PlayerSettings (Android) -> Other -> Configuration -> Internet Access. Set it to Require. It's described here : https://docs.unity3d.com/Manual/class-PlayerSettingsAndroid.html#Configuration

One additional thing you should try is to set "API Compatibility Level" to ".Net 4.x".

@in0finite Thank you for the reply,

Unfortunately that did not fix it. The android device just can't find any ip address (other than itself).
But a windows computer should search for an android devices. So I can work around this problem.

Thanks again!