Bug 10357 - Captured images returned from media picker throw IOException 'ERROR_ALREADY_EXISTS' on LG P500 model phone
Summary: Captured images returned from media picker throw IOException 'ERROR_ALREADY_E...
Status: RESOLVED FIXED
Alias: None
Product: Mobile API (Preview)
Classification: Xamarin
Component: Xamarin.Android ()
Version: Preview 0.6.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Eric Maupin
URL:
Depends on:
Blocks:
 
Reported: 2013-02-17 18:07 UTC by Paul Ryland
Modified: 2013-03-20 18:20 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Paul Ryland 2013-02-17 18:07:37 UTC
In our application we've noticed that, on an LG P500 model phone (android version 2.3.3), that an exception is thrown in the 'OnActivityResult' method within the Xamarin.Media.MediaPickerActivity as the picker returns from capturing a photo. Below is a section of the logcat output showing the error:

E/CAM_FD  ( 1461): cam_conf: CAMERA_EXIT
I/QualcommCameraHardware( 1461): release X: mCameraRunning = 0, mFrameThreadRunning = 0
I/QualcommCameraHardware( 1461): mVideoThreadRunning = 0, mSnapshotThreadRunning = 0, mJpegThreadRunning = 0
I/QualcommCameraHardware( 1461): camframe_timeout_flag = 0, mAutoFocusThreadRunning = 0
I/QualcommCameraHardware( 1461): ~QualcommCameraHardware E
I/QualcommCameraHardware( 1461): ~QualcommCameraHardware X
W/CameraApp(17927): <!>com.lge.camera.CameraApp 3032<!> stopReceivingLocationUpdates
D/CameraApp(17927): <!>com.lge.camera.CameraApp 3033<!> &&stopReceivingLocationUpdates
D/CameraApp(17927): <!>com.lge.camera.FileNamingHelper 67<!> FileNamingHelper close
D/CameraApp(17927): <!>com.lge.camera.utils.Common 373<!> saved picture counter = 193
D/CameraApp(17927): <!>com.lge.camera.utils.Common 386<!> saved video counter = 28
W/BackupManagerService( 1559): dataChanged but no participant pkg='com.android.providers.settings' uid=10018
I/WindowManager( 1559): Setting rotation to 3, animFlags=1
I/MonoDroid(17659): <!>xamarin.media.MediaPickerActivity -2<!> UNHANDLED EXCEPTION: System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path:
I/MonoDroid(17659): at System.IO.File.Move (string,string) <0x002a8>
I/MonoDroid(17659): at Xamarin.Media.MediaPickerActivity.MoveFile (Android.Net.Uri) <0x00117>
I/MonoDroid(17659): at Xamarin.Media.MediaPickerActivity.OnActivityResult (int,Android.App.Result,Android.Content.Intent) <0x0011f>
I/MonoDroid(17659): at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (intptr,intptr,int,int,intptr) <0x00077>
I/MonoDroid(17659): at (wrapper dynamic-method) object.7159d9cd-b2b7-407c-a0df-a1652ec982a5 (intptr,intptr,int,int,intptr) <0x0005b>
E/VLM     (17659): <!>xamarin.media.MediaPickerActivity -2<!> [static]Unhandled Exception
E/VLM     (17659): System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path:
E/VLM     (17659): at System.IO.File.Move (string,string) <0x002a8>
E/VLM     (17659): at Xamarin.Media.MediaPickerActivity.MoveFile (Android.Net.Uri) <0x00117>
E/VLM     (17659): at Xamarin.Media.MediaPickerActivity.OnActivityResult (int,Android.App.Result,Android.Content.Intent) <0x0011f>
E/VLM     (17659): at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (intptr,intptr,int,int,intptr) <0x00077>
E/VLM     (17659): at (wrapper dynamic-method) object.7159d9cd-b2b7-407c-a0df-a1652ec982a5 (intptr,intptr,int,int,intptr) <0x0005b>
I/BugSenseHandler(17659): <!>com.bugsense.trace.BugSenseHandler -1<!> Saving handled exception
E/mono    (17659):
E/mono    (17659): Unhandled Exception:
E/mono    (17659): System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path:
E/mono    (17659):   at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0
E/mono    (17659):   at Xamarin.Media.MediaPickerActivity.MoveFile (Android.Net.Uri url) [0x00000] in <filename unknown>:0
E/mono    (17659):   at Xamarin.Media.MediaPickerActivity.OnActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0
E/mono    (17659):   at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (IntPtr jnienv, IntPtr native__this, Int32 requestCode, Int32 native_resultCode, IntPtr n
ative_data) [0x00000] in <filename unknown>:0
E/mono    (17659):   at (wrapper dynamic-method) object:7159d9cd-b2b7-407c-a0df-a1652ec982a5 (intptr,intptr,int,int,intptr)
I/mono    (17659): [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path:
I/mono    (17659):   at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0
I/mono    (17659):   at Xamarin.Media.MediaPickerActivity.MoveFile (Android.Net.Uri url) [0x00000] in <filename unknown>:0
I/mono    (17659):   at Xamarin.Media.MediaPickerActivity.OnActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0
I/mono    (17659):   at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (IntPtr jnienv, IntPtr native__this, Int32 requestCode, Int32 native_resultCode, IntPtr n
ative_data) [0x00000] in <filename unknown>:0
I/mono    (17659):   at (wrapper dynamic-method) object:7159d9cd-b2b7-407c-a0df-a1652ec982a5 (intptr,intptr,int,int,intptr)
D/CameraApp(17927): <!>com.lge.camera.CameraApp 1203<!> onStop()
I/CameraApp(17927): <!>com.lge.camera.CameraApp 579<!> onDestroy()
D/CameraApp(17927): <!>com.lge.camera.CameraApp 12888<!> surfaceDestroyed()
D/CameraApp(17927): <!>com.lge.camera.CameraApp 2856<!> clearFocusState()
D/CameraApp(17927): <!>com.lge.camera.CameraApp 2806<!> updateFocusIndicator()
I/ActivityManager( 1559): Process com.intranel.mobilebullet (pid 17659) has died.


We are calling the MediaPicker.TakePhotoAsync() method with StoreCameraMediaOptions containing a sub directory that is definitely unique on the device. It's possible this bug is related to Bug #5380
Comment 1 Eric Maupin 2013-02-17 18:22:32 UTC
Do you get this issue running the MediaPicker sample on this device as well?
Comment 2 Paul Ryland 2013-02-17 19:03:02 UTC
Hi,

Yes I do see the same problem with the MediaPickerSample. For reference here's the logcat output, it looks basically the same as above:

E/CAM_FD  ( 1461): cam_conf: CAMERA_EXIT

I/QualcommCameraHardware( 1461): release X: mCameraRunning = 0, mFrameThreadRunning = 0

I/QualcommCameraHardware( 1461): mVideoThreadRunning = 0, mSnapshotThreadRunning = 0, mJpegThreadRunning = 0

I/QualcommCameraHardware( 1461): camframe_timeout_flag = 0, mAutoFocusThreadRunning = 0

I/QualcommCameraHardware( 1461): ~QualcommCameraHardware E

I/QualcommCameraHardware( 1461): ~QualcommCameraHardware X

W/CameraApp(28664): <!>com.lge.camera.CameraApp 3032<!> stopReceivingLocationUpdates

D/CameraApp(28664): <!>com.lge.camera.CameraApp 3033<!> &&stopReceivingLocationUpdates

D/CameraApp(28664): <!>com.lge.camera.FileNamingHelper 67<!> FileNamingHelper close

D/CameraApp(28664): <!>com.lge.camera.utils.Common 373<!> saved picture counter = 202

D/CameraApp(28664): <!>com.lge.camera.utils.Common 386<!> saved video counter = 28

W/BackupManagerService( 1559): dataChanged but no participant pkg='com.android.providers.settings' uid=10018

I/WindowManager( 1559): Setting rotation to 0, animFlags=1

I/ActivityManager( 1559): Config changed: { scale=1.0 imsi=530/1 loc=en_NZ touch=3 keys=1/1/2 nav=1/1 orien=1 layout=18 uiMode=17 seq=620}

D/[brighthy_log]( 1665): <!>com.android.internal.telephony.gsm.GsmServiceStateTracker$3 206<!> [BRIGHTHY] Enter ACTION_CONFIGURATION_CHANGED

I/MonoDroid(29162): <!>xamarin.media.MediaPickerActivity -2<!> UNHANDLED EXCEPTION: System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: 

I/MonoDroid(29162): at System.IO.File.Move (string,string) <0x002a8>

I/MonoDroid(29162): at Xamarin.Media.MediaPickerActivity.MoveFile (Android.Net.Uri) <0x00117>

I/MonoDroid(29162): at Xamarin.Media.MediaPickerActivity.OnActivityResult (int,Android.App.Result,Android.Content.Intent) <0x0011f>

I/MonoDroid(29162): at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (intptr,intptr,int,int,intptr) <0x00077>

I/MonoDroid(29162): at (wrapper dynamic-method) object.40ce3984-9714-49c9-a70e-4abc1dd3d57c (intptr,intptr,int,int,intptr) <0x0005b>

E/mono    (29162): 

E/mono    (29162): Unhandled Exception:

E/mono    (29162): System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: 

E/mono    (29162):   at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0 

E/mono    (29162):   at Xamarin.Media.MediaPickerActivity.MoveFile (Android.Net.Uri url) [0x00000] in <filename unknown>:0 

E/mono    (29162):   at Xamarin.Media.MediaPickerActivity.OnActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0 

E/mono    (29162):   at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (IntPtr jnienv, IntPtr native__this, Int32 requestCode, Int32 native_resultCode, IntPtr native_data) [0x00000] in <filename unknown>:0 

E/mono    (29162):   at (wrapper dynamic-method) object:40ce3984-9714-49c9-a70e-4abc1dd3d57c (intptr,intptr,int,int,intptr)

I/mono    (29162): [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: 

I/mono    (29162):   at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x00000] in <filename unknown>:0 

I/mono    (29162):   at Xamarin.Media.MediaPickerActivity.MoveFile (Android.Net.Uri url) [0x00000] in <filename unknown>:0 

I/mono    (29162):   at Xamarin.Media.MediaPickerActivity.OnActivityResult (Int32 requestCode, Result resultCode, Android.Content.Intent data) [0x00000] in <filename unknown>:0 

I/mono    (29162):   at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (IntPtr jnienv, IntPtr native__this, Int32 requestCode, Int32 native_resultCode, IntPtr native_data) [0x00000] in <filename unknown>:0 

I/mono    (29162):   at (wrapper dynamic-method) object:40ce3984-9714-49c9-a70e-4abc1dd3d57c (intptr,intptr,int,int,intptr)

E/InputDispatcher( 1559): channel '40948630 MediaPickerSample.MediaPickerSample/mediapickersample.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8

E/InputDispatcher( 1559): channel '40948630 MediaPickerSample.MediaPickerSample/mediapickersample.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

I/WindowManager( 1559): WINDOW DIED Window{40948630 MediaPickerSample.MediaPickerSample/mediapickersample.MainActivity paused=false}

I/ActivityManager( 1559): Process MediaPickerSample.MediaPickerSample (pid 29162) has died.
Comment 3 Eric Maupin 2013-03-11 14:09:46 UTC
I have not been able to reproduce this, but I believe I've identified the cause. I've committed a fix for this which will go out with the next release.
Comment 4 Eric Maupin 2013-03-20 18:20:02 UTC
Fixed in 0.6.3, which is now available.