Getting "Sharing violation path exception" when I access image in ImageSaved event in Android

We are getting "Sharing violation path exception" when I access image after image saved is called for image editor in Android, Here is my code



Here is my code to read image after image is saved.


When I try to read image it throws exception of image sharing. I think possible issue could be
1. Image is still not saved and used by SfimageEditor so its creates issues. if this is the case then ImageSaved should be called after image is saved properly.
2. Another reason could be that objects are not disposed properly after saving image and image is still used by them.

One more thing I noticed in android is ImageSaved is called first and then ImageSaving is called, its reverse in case of IOS(As per naming the flow I see in IOS is correct).
Ideally ImageSaving should be called first and then ImageSaved. 

FYI : All these logical flow works fine for IOS application.

6 Replies

SG Sri Gayathri Gopalakrishnan Syncfusion Team October 27, 2017 05:20 PM UTC

Hi Maulik ,

Thanks for using Syncfusion Products,

Query:Sharing Violation Path Exception

We have analysed your query and we have already logged bug report for the same. The fix will be included in our upcoming volume 4 release which is expected to be rolled out at the first week of November 2017.

We appreciate your patience until then.

Regards,
Sri Gayathri.G


ZH Zuhair Haroon Khan January 16, 2020 03:57 PM UTC

Hi Sri ,

I am getting the same exception 


        public void SaveDoc(MemoryStream memoryStream, string localFileName)
        {
            try
            {
                string currentDirectoryPath = FileSystem.AppDataDirectory;

                string createFolderInDir = Path.Combine(currentDirectoryPath, "EFB_Bookmarks_Keeper");

                if (!Directory.Exists(createFolderInDir))
                    Directory.CreateDirectory(createFolderInDir);

                string filepath = Path.Combine(createFolderInDir, localFileName);

                using (FileStream fileStream = new FileStream(filepath, FileMode.OpenOrCreate))
                {
                    memoryStream.CopyTo(fileStream);
                }

            }
            catch (Exception ex)
            {


            }
        }


RS Ramya Soundar Rajan Syncfusion Team January 20, 2020 12:58 PM UTC

Hi Zuhair, 
 
 
We are not able to reproduce reported issue in our side. We have analysed your code and suspect the issue may be raised if the root folder access is denied. Could please check your side if your saved location is accessable or not. If you still facing the problem even after providing the root folder permission. Please find the sample link from below location. 
  
  
Regards, 
Ramya. 



ZH Zuhair Haroon Khan January 24, 2020 10:59 AM UTC

Hi 

Still I have given access to my root folder but still have the same error


ZH Zuhair Haroon Khan January 24, 2020 11:00 AM UTC

1) First I save the document successfully but second time  I got this error  


RS Ramya Soundar Rajan Syncfusion Team January 27, 2020 11:41 AM UTC

Hi Zuhair, 
 
We have tried to reproduce the reported issue at our side by saving the image again and again but we afraid that we are not able to reproduce the issue at our end. Could you please modify the previously given sample to replicate the problem? 
 
Regards, 
Ramya 
  


Loader.
Up arrow icon