Skip to content

Android 0.3.0: can't connect to LAN servers on Android 17 (missing ACCESS_LOCAL_NETWORK) #62934

Open

Description

@osctorand

Description

The Android app targets SDK 37 but doesn't declare android.permission.ACCESS_LOCAL_NETWORK. On Android 17, apps targeting SDK 37 need that permission to reach the local network, so the OS drops the connection before it leaves the phone. Pairing fails with a timeout, the server never sees a connection, and the app has no local network permission for the user to grant.

Fix: declare ACCESS_LOCAL_NETWORK in the manifest and request it at runtime before connecting to a local address. https://developer.android.com/privacy-and-security/local-network-permission

Plugins

No response

OpenCode version

Android app 0.3.0 (39), server 2.2.6

Steps to reproduce

  1. Use an Android 17 device on Wi-Fi with no VPN, and run an OpenCode server on the same subnet.
  2. On the server, run opencode pair --url http://<hostname>.local:4096.
  3. Scan the QR code in the app.

Result: URLError -1001 timedOut after about 15 s. The app logs GET /auth/…: URLError -1001 (SocketTimeoutException), a packet capture on the server shows no SYN, and adb shell dumpsys appops --package ai.opencode.mobilecode shows a Reject for ACCESS_LOCAL_NETWORK.

Expected: the app asks for the local network permission and connects.

Screenshot

No response

Operating System

Android 17 (API 37)

Terminal

No response

Activity

  1. opencodejr commented on Nov 9, 2026

    @opencodejr

    Thanks for the detailed diagnosis, @osctorand: the packet capture and the dumpsys appops output make the cause very clear.

    I couldn't reproduce this in our automated environment. It has no Android 17 device or emulator and no copy of the 0.3.0 (39) build, and the Android app's source isn't in this repository, so I couldn't check its manifest either. A maintainer with access to the mobile app will need to confirm that ACCESS_LOCAL_NETWORK is missing and that pairing over the LAN fails on API 37.

    The server side (2.2.6 and opencode pair) doesn't look involved, since no connection attempt ever reached the server.

    Related, though not the same problem:

  2. a-wayne commented on Nov 9, 2026

    @a-wayne

    I'm having the same issue. I just updated my S24 Ultra to Android 17. There's no way to manually give the app this permission without it asking first, so I suppose we'll have to wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions