Manifest & Permissions

Android INTERNET Permission: Manifest Placement and Connection Failures

The Android INTERNET permission belongs directly inside <manifest>, not inside <application>. It allows network access under platform rules and does not require a runtime permission dialog. A connection can still fail because of DNS, TLS, cleartext policy or an unreachable endpoint.

By Updated 2 min read

Put the declaration in the correct place

XML · REFERENCE EXAMPLE
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:label="Example"
        ... />
</manifest>

This is a placement illustration; the ellipsis is not literal XML for a working project. Check the manifest reference and inspect the merged manifest for the variant you actually install.

Diagnose the error instead of adding permissions blindly

Symptom First investigation
Cleartext traffic rejected HTTP URL or redirect and network security configuration
Unknown host DNS, host spelling and device connectivity
Certificate failure Certificate chain, hostname and device time
Timeout Endpoint reachability, firewall or server responsiveness
Main-thread exception Move blocking network work off the UI thread

ACCESS_NETWORK_STATE can support connectivity-related APIs, but it does not replace INTERNET. Neither declaration fixes an incorrect URL or authorizes a server request.

Check the development environment

On a physical device, localhost points to that device. On an emulator, reaching a development server can require the emulator's documented host mapping or a controlled reverse-port setup. Ensure the server listens on the intended interface and that the device can reach it.

Do not broaden production cleartext access to compensate for a development networking mistake. Use HTTPS or a debug-only, narrowly scoped exception where necessary.

Verify the packaged configuration

Inspect the release manifest and Network Security Configuration. A library, flavor or source-set override can change the effective rules. Test at least one successful request and one expected failure so a permissive workaround is not mistaken for a correct configuration.

Use APKLint for the manifest check

The Manifest Checker can catch placement and declaration issues in pasted XML. It cannot contact your private server or prove that its certificate and authorization are correct. Keep manifest validation and endpoint diagnosis as separate steps.

Sources and further reading

  1. Android Developers: App manifest overview
  2. Android Developers: Manifest.permission reference
  3. Android Developers: Network security configuration

Reference review: 22 September 2026. Examples illustrate the workflow; check your installed versions, release artifact and account-specific Console requirements before applying them. This guide is not a claim that APKLint executed your project or verified your private account.

APKLint

Android inspection tools and practical release guides. About APKLint · Report a correction