Search code examples
androidkotlinandroid-permissionsandroid-networkingandroid-network-security-config

Android app is able to make network calls without network permissions defined in the manifest


I am developing an Android app.

I haven't added the permissions below to the manifest but the app is still able to make network calls successfully without any exception.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

I use the latest Retrofit and Okhttp versions to make the network calls, minimum SDK is 21, compile SDK is 29. I created an empty project and tried without permissions again but this time got the exception for missing permissions.

Does anyone any idea about the reason? Any help would be appreciated.


Solution

  • Most likely, a library that you are using has added that permission. If you want, use the "Merged Manifest" sub-tab in the AndroidManifest.xml editor to try to track down which library (or libraries) are contributing the INTERNET permission.