Skip to content

Android app cannot connect to LAN Agent: SocketException Operation not permitted #5

@wzz6423

Description

@wzz6423

Problem

Android app fails to load dashboard when connecting to a LAN CodexFlow Agent.

Agent address:

http://192.168.31.32:4318

Error shown in app:

ClientException with SocketException:
Connection failed (OS Error: Operation not permitted, errno = 1),
address = 192.168.31.32, port = 4318,
uri = http://192.168.31.32:4318/api/v1/dashboard

Expected

Android app should be able to fetch:

GET http://:4318/api/v1/dashboard

when the Agent is started with:

CODEXFLOW_LISTEN_ADDR=0.0.0.0:4318

Observed

Mac Agent is reachable from browser / Web client, but Android app fails before loading dashboard.

Suspected Cause

The installed Android APK likely does not have network access enabled in the final packaged manifest, or the release package does not allow HTTP LAN access.

The error Operation not permitted, errno = 1 is consistent with Android denying socket access, commonly caused by missing android.permission.INTERNET in the final installed APK.

A second thing to verify is Android cleartext HTTP policy, because the Agent is currently served over plain HTTP:

http://192.168.x.x:4318

Checks Needed

  • Verify final merged release manifest contains:
<uses-permission android:name="android.permission.INTERNET" />
  • Verify the generated APK actually includes android.permission.INTERNET.
  • If INTERNET permission exists but the request is still blocked, verify whether cleartext HTTP to LAN IPs is allowed for release builds.

Acceptance Criteria

  • Android release APK can connect to http://:4318/api/v1/dashboard.
  • App no longer shows SocketException: Operation not permitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions