-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
NetworkInterface.GetAllNetworkInterfaces() on Android leads to FileNotFoundException #77441
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
/cc @grendello it's possible this is something in xamarin/xamarin-android |
@jonathanpeppers it's possible, although the code that lives in xamarin/xamarin-android (and which was moved to dotnet/runtime recently) deals with enumerating interface addresses, not interfaces themselves. The code which enumerates interfaces lives in dotnet/runtime. I'll try to repro this issue and when/if I see the trace I'll be able to tell more. |
Note that it might be due to tightened security on Android, since they have been gradually restricting access to bits and pieces of information about the system. |
Note first line: |
Yes, that's what it appears to be. xamarin/xamarin-android does use netlink when Until very recently the dotnet/runtime implementation always used the netlink implementation, with the commit linked to previously switching to the same strategy as the implementation in Xamarin.Android, to dynamically look up /cc @simonrozsival was your fix above backported to net6? Or is it going to be part of only net7+? |
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue DetailsDescriptionThis has been reported previously in #3617 but problem still exists. I have tried the following combinations:
Steps to Reproduce
Result the application crash with FileNotFoundException. Link to public reproduction project repositoryhttps://github.com/dotnet/maui-samples/tree/main/6.0/Fundamentals/Shell Version with bug6.0.486 (current) Last version that worked wellUnknown/Other Affected platformsAndroid Affected platform versionsAndroid 11-13 + Windows Subsystem for Android Version 2207.40000.8.0 Did you find any workaround?No response Relevant log outputwindows-subsystem-android-crash-log.txt
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionThis has been reported previously in #3617 but problem still exists. I have tried the following combinations:
Steps to Reproduce
Result the application crash with FileNotFoundException. Link to public reproduction project repositoryhttps://github.com/dotnet/maui-samples/tree/main/6.0/Fundamentals/Shell Version with bug6.0.486 (current) Last version that worked wellUnknown/Other Affected platformsAndroid Affected platform versionsAndroid 11-13 + Windows Subsystem for Android Version 2207.40000.8.0 Did you find any workaround?No response Relevant log outputwindows-subsystem-android-crash-log.txt
|
@grendello the most recent fix should be included in a servicing release of .NET 6 soon: #77260 |
Have tried with new .Net 6.0.12. |
Thanks for the feedback and great to hear it works now! I assume we can close this issue then or is there something left? |
I have no other issues for now |
Description
This has been reported previously in #3617 but problem still exists.
I have tried the following combinations:
Steps to Reproduce
Get MAUI sample app
Add Permissions:
[assembly: UsesPermission(Android.Manifest.Permission.AccessNetworkState)]
[assembly: UsesPermission(Android.Manifest.Permission.ChangeNetworkState)]
[assembly: UsesPermission(Android.Manifest.Permission.AccessWifiState)]
[assembly: UsesPermission(Android.Manifest.Permission.ChangeWifiMulticastState)]
[assembly: UsesPermission(Android.Manifest.Permission.ChangeWifiState)]
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
Add a call to System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() on a button click (E.g. in AboutPage TabCommand)
Result the application crash with FileNotFoundException.
Link to public reproduction project repository
https://github.com/dotnet/maui-samples/tree/main/6.0/Fundamentals/Shell
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11-13 + Windows Subsystem for Android Version 2207.40000.8.0
Did you find any workaround?
No response
Relevant log output
windows-subsystem-android-crash-log.txt
The text was updated successfully, but these errors were encountered: