'Xanarin Android - Machine is not on the network

We have a Xamarin app for Android. We are attempting to show a Webview (in Xamarin). It works perfectly when the app first starts - whether we are on WiFi or mobile networks.

However, if we are on a WiFi network and switch to the mobile network it fails with the following:

chromium: [WARNING:net_errors_posix.cc(127)] Unknown error Machine is not on the network (64) mapped to net::ERR_FAILED
chromium: [ERROR:socket_posix.cc(96)] CreatePlatformSocket() failed: Machine is not on the network (64)

if we then switch back to the wifi network - it works again.

If we create a native Android app with a webview it works perfectly.

It's only when we use the Xamarin webview that the problem occurs.

Ping still works and so does going to a site via a web browser in Android. It's only through the webview that it fails.

One important note: We call a native Android aar which performs all sorts of initialisations for an SDK. Our guess is it is something in there that is causing the problems since, when we remove it, everything works. What could be out problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source