-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetAllNetworkInterfaces fails on Android #35836
Comments
Tagging subscribers to this area: @dotnet/ncl |
Is the /proc available like normal Linux? The NetworkInfo code heavily depends on it and we have seen similar cases on the past with WSL when some entries are missing or incomplete. Also this looks like unhandled exception more than crash. |
This looks like something we'll need to resolve similar to our HttpHandler integration. In mono, we were reaching into Xamarin libraries we won't have access to. |
A new version of Mono.Android-Tests has been added to run against the .NET 6 SDK: * `tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj` To support this, new .NET `.csproj` files have been added alongside all of the existing legacy Xamarin.Android unit test library projects. These projects target `net5.0-android` and build against our .NET 6 SDK (6f761ea): * `src/Mono.Android/Test/Java.Interop-Tests/Java.Interop-Tests.NET.csproj` * `src/Mono.Android/Test/Mono.Android-Test.Library/Mono.Android-Test.Library.NET.csproj` * `src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.NET.csproj` * `tests/TestRunner.Core/TestRunner.Core.NET.csproj` * `tests/TestRunner.NUnit/TestRunner.NUnit.NET.csproj` The `_CreateAar` target was being skipped for the new `Java.Interop-Tests.NET` project, as it had no inputs. As a result, the `Mono.Android-Test-classes.jar` file required by these tests was not being included in the application project. To fix this, I've added `@(AndroidJavaLibrary)` to `@(_CreateAarInputs)` so that these items will also be considered as inputs for this target/task. All tests which have been ignored are tied back to one of the following issues: * Mono.Data.Sqlite is not supported. * Secondary AppDomains are not supported. * Missing crypto/networking support in dotnet/runtime. * dotnet/runtime#35836 * dotnet/runtime#44358 * #5265 * #5275
@steveisok To provide a quick update here, this issue is still present in 6.0.0-preview.4.21177.4. |
Related to #51303 |
can you check @steveisok what file it is trying to access and if we are hitting the "getifaddrs" path or the legacy /proc implementation? |
https://github.com/morristech/android-ifaddrs is 8 years old and I'm wondering if anything changed since then. Netlink now works (somehow) with .NET so we could do something similar if needed. That would possibly allow some other NetworkInfo functions as well if needed. |
https://android.googlesource.com/platform/bionic/+/master/libc/include/ifaddrs.h |
Closing this in favour of #51303 |
System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces ()
is crashing on Android when using our very early Xamarin SDK preview bits:
Steps to Reproduce
This project is configured to run on an
x86
emulator by default. If you want to test on a physical device theRuntimeIdentifier
element in the .csproj file will need to be updated.The text was updated successfully, but these errors were encountered: