ImagePicker icon indicating copy to clipboard operation
ImagePicker copied to clipboard

java.io.IOException: Operation not permitted

Open hrushikeshthule opened this issue 4 years ago • 4 comments

java.io.IOException: Operation not permitted java.io.UnixFileSystem.createFileExclusively0(Native Method) java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:317) java.io.File.createNewFile(File.java:1008) com.github.dhaval2404.imagepicker.util.FileUtil.getImageFile(FileUtil.kt:51) com.github.dhaval2404.imagepicker.provider.CropProvider.cropImage(CropProvider.kt:105) com.github.dhaval2404.imagepicker.provider.CropProvider.startIntent(CropProvider.kt:95) com.github.dhaval2404.imagepicker.ImagePickerActivity.setImage(ImagePickerActivity.kt:128) com.github.dhaval2404.imagepicker.provider.GalleryProvider.handleResult(GalleryProvider.kt:75) com.github.dhaval2404.imagepicker.provider.GalleryProvider.onActivityResult(GalleryProvider.kt:61) com.github.dhaval2404.imagepicker.ImagePickerActivity.onActivityResult(ImagePickerActivity.kt:110) android.app.Activity.dispatchActivityResult(Activity.java:8541) android.app.ActivityThread.deliverResults(ActivityThread.java:5499) android.app.ActivityThread.handleSendResult(ActivityThread.java:5547) android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) android.os.Handler.dispatchMessage(Handler.java:106) android.os.Looper.loop(Looper.java:246) android.app.ActivityThread.main(ActivityThread.java:8506) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)

Summary

Code to reproduce

Android version

Impacted devices

Installation method

SDK version

Other information

hrushikeshthule avatar Aug 25 '21 03:08 hrushikeshthule

Hello @hrushikeshthule

As a temporary fix you could do: In your android/app/src/main/AndroidManifest.xml file, at

<application android:label="APPNAME" android:icon="ICONNAME" android:requestLegacyExternalStorage="true">

hitesh-dhamshaniya avatar Aug 25 '21 12:08 hitesh-dhamshaniya

@hrushikeshthule Can you please share the code to reproduce the issue along with the ImagePicker version and Android device OS Version that you have tested.

Without this, we will not be able to work on the issue.

Dhaval2404 avatar Aug 25 '21 17:08 Dhaval2404

java.io.IOException: Operation not permitted at java.io.UnixFileSystem.createFileExclusively0(Native Method) at com.github.dhaval2404.imagepicker.util.FileUtil.getImageFile(FileUtil.kt:46) at com.github.dhaval2404.imagepicker.util.FileUtil.getImageFile$default(FileUtil.kt:30)

android version : 11 model number : vivo 1818

Nehu112 avatar Oct 27 '22 10:10 Nehu112

W/System.err: java.io.IOException: Operation not permitted in android

ABUHURERA123 avatar Nov 22 '22 08:11 ABUHURERA123