Put the declaration in the correct place
<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
- Android Developers: App manifest overview
- Android Developers: Manifest.permission reference
- 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.



