Error in Save

I used the Image editor. After crop when I am going to save the image I am getting the error : 
System.UnauthorizedAccessException
  Message=Access to the path "/storage/emulated/0/Pictures/Image20210122123251243.jpg" is denied.
 Please Help.



9 Replies 1 reply marked as answer

RS Ramya Soundar Rajan Syncfusion Team January 25, 2021 10:23 AM UTC

 
Greeting from Syncfusion. 
 
We have checked your reported query and we suspect that the storage permission is not enabled for your installed application on the device. So, can you please enable the storage permission. Please refer the below screenshot. 
  
   
   
Or  
   
You can enable the storage permission at runtime. Please find the code snippet from below.  
   
Andriod:  
   
MainActivity.cs  
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity  
    {  
        private static int PERMISSION_REQUEST_CODE = 200;  
        protected override void OnCreate(Bundle savedInstanceState)  
        {  
           …  
   
            ActivityCompat.RequestPermissions(this, new String[] { Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadExternalStorage }, PERMISSION_REQUEST_CODE);  
   
        }  
        public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)  
        {  
            Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);  
   
            base.OnRequestPermissionsResult(requestCode, permissions, grantResults);  
        }  
    }  
   
   
We would like to suggest you to set the value of requestLegacyExternalStorage to true in your app's manifest file if the target version is 10 as like below code snippet. 
 
AndroidManifest.xml 
<manifest ...> 
 
  <application android:requestLegacyExternalStorage="true" ...> 
    ... 
  </application> 
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 
</manifest> 
 
Please refer the help below links below for more information.  
   
   
Please let us know, if you need any further assistance.  
 
Regards, 
Ramya S 


Marked as answer

JW Jason Williams August 18, 2021 05:03 PM UTC

Enabling "requestLegacyExternalStorage" is a stop-gap solution for SDK 29. If you target SDK 30 (Android 11), that flag doesn't work anymore. Is there going to be an update to the control that allows it to run on SDK 30? If so, when?

Thanks.



SS Sridevi Sivakumar Syncfusion Team August 19, 2021 10:18 AM UTC

Hi GrowthLadder,

We have checked the reported problem and we will fix this issue and it will be included in our next weekly NuGet release which expected to be rolled out on Aug 24,2021.

Let us know if you need any further assistance.

Regards,
Sridevi S. 



SS Sridevi Sivakumar Syncfusion Team August 19, 2021 10:20 AM UTC

Hi GrowthLadder,

We have checked the reported problem and we will fix this issue and it will be included in our next weekly NuGet release which expected to be rolled out on Aug 24,2021.

Let us know if you need any further assistance.

Regards,
Sridevi S. 



ET Eswaran Thirugnanasambandam Syncfusion Team August 25, 2021 08:56 AM UTC

Hi GrowthLadder, 
  
Sorry for the inconvenience. 
  
The reported issue has been resolved in higher Android versions. However, in lower Android versions, we are facing some technical issues. As a result, we were unable to include the patch in our weekly NuGet on August 24th as promised. The version compatibility issue will be fixed in our upcoming 2021 Volume 3 release, which is schedule to be rolled out on end of September 2021. We appreciate your patience until then. 
  
Regards, 
Eswaran 



DV Duong Van replied to Ramya Soundar Rajan January 27, 2022 08:10 AM UTC

Hi  Ramya Soundar Rajan

I also have problem like GrowthLadder. I have updated to the latest version but the problem is still not resolved.It happens only on android 11 even though I allow for android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION permission.

 Please Help. Thanks



ET Eswaran Thirugnanasambandam Syncfusion Team January 27, 2022 04:01 PM UTC

Hi GrowthLadder, 
 
We have prepared a sample and checked the reported problem with the latest android device. But we are unable to reproduce it from our side. Please find the tested sample from the below link. 
 
 
Tested device details: Redmi Note 8 (Android 11.0, API 30) 
 
If you still face the problem, can you please check with some other devices and revert by modifying the sample based on your scenario, this will help us to provide you with a better solution at the earliest. 
 
Regards, 
Eswaran. 



DV Duong Van replied to Eswaran Thirugnanasambandam January 28, 2022 01:58 AM UTC

Hi  Eswaran Thirugnanasambandam

My problem is after i edit then save the exception message. I used the Image editor or pdf editor. After crop when I am going to save the image or editor I am getting the error :

System.UnauthorizedAccessException
  Message=Access to the path "/storage/emulated/0/Download/Image1212.jpg" is denied.


ET Eswaran Thirugnanasambandam Syncfusion Team January 28, 2022 07:45 AM UTC

Hi GrowthLadder, 
 
We have tested the reported problem by cropping and saving the image. But we are unable to reproduce it from our side. We have prepared a video to show that SfImageEdior control doesn’t throws any exception when saving the edited image. Please find the video from the below link. 
 
 
Tested device details: Redmi Note 8 (Android 11.0, API 30) 
 
If you still face the problem, can you please share your device details and revert by modifying the previously provided sample based on your scenario, this will help us to provide you with a better solution at the earliest. 
 
Regards, 
Eswaran. 


Loader.
Up arrow icon