MatriX doesn't login in Xamarin

178 Views Asked by At

I'm trying to create a xmpp client on Xamarin using the MatriX.Xamarin.Android package. I have this very basic code running on my main activity:

using Android.OS;
using Android.Widget;
using Matrix;
using Matrix.Xmpp.Client;

namespace XmppAndroid
{
    [Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            var button = FindViewById<Button>(Resource.Id.button);
            button.Click += delegate
            {
                var jid = new Jid("[email protected]");
                var client = new XmppClient(jid);

                client.Password = "123456";
                client.OnLogin += delegate
                {
                    Toast.MakeText(this, "Logged!", ToastLength.Short).Show();
                };

                client.Open();
            };
        }
    }
}

When I try to run this code and I press the button nothing happens and I get the following message in the log:

12-10 17:49:20.409 W/oid.XmppAndroid(24630): type=1400 audit(0.0:6783): avc: denied { read } for name="u:object_r:net_dns_prop:s0" dev="tmpfs" ino=17213 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:net_dns_prop:s0 tclass=file permissive=0
12-10 17:49:20.411 E/libc    (24630): Access denied finding property "net.dns1"
12-10 17:49:20.409 W/oid.XmppAndroid(24630): type=1400 audit(0.0:6784): avc: denied { read } for name="u:object_r:net_dns_prop:s0" dev="tmpfs" ino=17213 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:net_dns_prop:s0 tclass=file permissive=0
12-10 17:49:20.409 W/oid.XmppAndroid(24630): type=1400 audit(0.0:6785): avc: denied { read } for name="u:object_r:net_dns_prop:s0" dev="tmpfs" ino=17213 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:net_dns_prop:s0 tclass=file permissive=0
12-10 17:49:20.413 E/libc    (24630): Access denied finding property "net.dns2"
12-10 17:49:20.409 W/oid.XmppAndroid(24630): type=1400 audit(0.0:6786): avc: denied { read } for name="u:object_r:net_dns_prop:s0" dev="tmpfs" ino=17213 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:net_dns_prop:s0 tclass=file permissive=0
12-10 17:49:20.413 E/libc    (24630): Access denied finding property "net.dns3"
12-10 17:49:20.414 E/libc    (24630): Access denied finding property "net.dns4"

I truly have no idea how to handle this problem. Any help would be welcomed.

0

There are 0 best solutions below