-
Notifications
You must be signed in to change notification settings - Fork 17.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
x/mobile: Calling net.InterfaceAddrs() fails on Android SDK 30 #40569
Comments
/cc @hyangah |
Any more updates on this one? Android 11 was released today. |
Reproduced in Yggdrasil project for net.Interfaces(): |
Any updates? |
I'd also love an update, if possible. This is blocking a project of mine right now. |
Anybody looking into this? |
Seems to be caused by these new restrictions in Android 11:
https://developer.android.com/training/articles/user-data-ids#mac-11-plus |
https://developer.android.com/distribute/best-practices/develop/target-sdk In August 2021, new apps in the Google Play Store will be required to target API level 30. |
Any updates on this one? This fix did not work for us: Catfriend1/syncthing-android#800 |
Hello golang dev team, any update on this issue? This is blocking the Android 11 compatibility of my app :/. Thanks! |
We ended up developing an alternative using Android APIs, which we call instead of getInterfaceAddrs(). |
Great, will take a look and see if I can circumvent my issue with this . Thanks!
Sent from myMail for iOS
Thursday, 9 December 2021 14:39 -0600 from ***@***.*** ***@***.***>:
…We ended up developing an alternative using Android APIs, which we call instead of getInterfaceAddrs().
tailscale/tailscale-android#21
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub , or unsubscribe .
Triage notifications on the go with GitHub Mobile for iOS or Android .
|
I'm having a question: This problem is open since 2020. There is no workaround. Basically it means, that all Android apps, relying on GO in some way and "doing network things", will not work if they are running Android 11 or higher (at least the latter is for sure not that exotic anymore as it was in 2020) I'm wondering why this issue is not making bigger waves, but most likely the relevance of gomobile for Android is lower than expected (which is kind of a pity, since it is in some limited ways a perfect replacement of C++). But at least network things should be working. |
Same suffering here. 4 years old bug, unbelievable! Findings, while using same gomobile arr in Android App,
Is there any workaround available, even only with targetSdkVersion 29? |
@invented-pro At least for me it is solved. Apply this PR to a source installation of GOLANG #61089 |
I'll take a try. Thanks @neilyoung |
@wlynxg what's the current state of the PR? |
Merging is blocked for some reasons. |
src + PR build on macos failed due to some tests. |
@invented-pro I'm on macOS 14.2.1, M1 |
cannot build on 14.2.1 M2 |
I had a recent binary installation on disk, then followed this gist https://go.dev/doc/install/source. Applied the patch manually. Made the patched GOLANG default then. EDIT: Aarggh.... Realized right now, that I did it on Ubuntu 20.04. Sorry for this... |
Thanks. I'll try on linux. |
I built golang from src patched with PR61089, then used it to build aar file, finally it works as expected now on Android11 & 13, no "netlinkrib: permission denied" anymore. Sincerely thank @wlynxg for the PR !!! Thank @neilyoung for guidance!!! Hints to whom it may concern:
|
@invented-pro Thanks for letting me know. Yes, this PR is really worth to be merged finally. Thanks also for the extra information, even though I cannot confirm your last issue. |
Actually the PR is'nt ready yet |
Fix confirmed |
He solved my problem thanks |
'github.com/wlynxg/anet' is a partial alternative implementation of the 'golang.org/x/net' module. The goal of 'anet' module is to provide workarounds of the issues golang/go#40569 and golang/go#68082 on Android 11+.
'github.com/wlynxg/anet' is a partial alternative implementation of the 'golang.org/x/net' module. The goal of 'anet' module is to provide workarounds of the issues golang/go#40569 and golang/go#68082 on Android 11+.
This solution is bases on https://github.com/wlynxg/anet project. `github.com/wlynxg/anet` is a partial alternative implementation of the `golang.org/x/net` module. The goal of `anet` module is to provide workarounds of the issues golang/go#40569 and golang/go#68082 on Android 11+. Tested on AOSP 13. Resolves: #1149
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Calling
net.InterfaceAddrs()
fails on Android app targetting SDK version 30. Withbuild.gradle
looking like:Building the exact same app targetting SDK 29 works, and returns no error:
What did you expect to see?
Targetting SDK 30 would behave no differently.
What did you see instead?
Calling
net.InterfaceAddrs()
results in errorroute ip+net: netlinkrib: permission denied
when embedded in Android app targetting SDK 30 (R):The text was updated successfully, but these errors were encountered: