How to add permission to manifest file in Android application

Asked 2 years ago, Updated 2 years ago, 129 views

I use HttpURLConnection to access http link to download files from Android. Logcat displays this error

WARN/System.err(223): java.net.SocketException: Permission denied (maybe missing INTERNET permission)

So I added it to Android.Manifest.permission of my app, but the same error appears, what should I do?

android exception android-manifest

2022-09-21 21:08

1 Answers

<manifest xlmns:android...>
 ...
 <uses-permission android:name="android.permission.INTERNET" />
 <application ...
</manifest>

If you look at the Logcat error, it seems that the manifest file did not give a permission. Go to AndroidManifest.xml Add <uses-permission android:name="android.permission.INTERNET" /> as shown above.


2022-09-21 21:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.