eperm operation not permitted
eperm operation not permitted

Hi Guys, Welcome to Proto Coders Point. So once i was trying to implement programmatically taking screenshot in android ap development and I faced a problem while saving the captured screenshot to gallery, & this is the error i got FileNotFoundException: open failed: EPERM (Operation not permitted), After lot’s of trial & error, finally got the solution to solve EPERM issue in android while saving file in android.

 Let’s start to solve operation not permitted issue in android

How To Solve FileNotFoundException open failed: EPERM (Operation not permitted) Error

Here is a very simple soltion to easily solve FileNotFoundException open Failed: EPERM: You have to has a permission where you are allowing you android appliation to access External Storage, add it.

To add requestLegacyExternalStorage, just go to AndroidManifest.xml

Project > app > manifest > AndroidManifest.xml

Open it, then inside application tag add

 android:requestLegacyExternalStorage=”true” 

For Reference image:

make legacy extenal storage to true

Now, just Uninstall app and reinstall app it again & you will see your eror got successfully solved.