MediaImplementation.TakeMediaAsync Exception
See original GitHub issueBug
Sometimes on Android when taking a photo I get that excpetion.
Version Number of Plugin: 2.6.0.12-beta Device Tested On: LENOVO T2-A7-20F
Package: com.rolsped.TruckerApp Version Code: 27 Version Name: 1.0 Android: 4.4.2 Android Build: T2-A7-20F_S000009_151022_ROW Manufacturer: Lenovo Model: Tab2A7-20F Thread: main-1 Start Date: Wed Oct 26 20:56:22 CEST 2016 Date: Wed Oct 26 21:03:27 CEST 2016 Format: Xamarin
Xamarin caused by: android.runtime.JavaProxyThrowable: System.InvalidOperationException: Only one operation can be active at a time at Plugin.Media.MediaImplementation.TakeMediaAsync (System.String type, System.String action, Plugin.Media.Abstractions.StoreMediaOptions options) [0x00039] in <35066fbd82df477487a6a1e39050b480>:0 at Plugin.Media.MediaImplementation+<PickPhotoAsync>d__17.MoveNext () [0x0008a] in <35066fbd82df477487a6a1e39050b480>:0 — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <fe5ae17f49cd42d9923d7a78735dd424>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <fe5ae17f49cd42d9923d7a78735dd424>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <fe5ae17f49cd42d9923d7a78735dd424>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <fe5ae17f49cd42d9923d7a78735dd424>:0 at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <fe5ae17f49cd42d9923d7a78735dd424>:0 at trucker_rolsped.Pages.MediaPage+<<-ctor>b__5_2>d.MoveNext () [0x001ce] in <097cdfc3784648edab9e909af0f616aa>:0 — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <fe5ae17f49cd42d9923d7a78735dd424>:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (System.Object state) [0x00000] in <fe5ae17f49cd42d9923d7a78735dd424>:0 at Android.App.SyncContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in <79e6945a2f4a4e2f844e36c860dfb012>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <79e6945a2f4a4e2f844e36c860dfb012>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <79e6945a2f4a4e2f844e36c860dfb012>:0 at (wrapper dynamic-method) System.Object:93cfcaba-4c78-4a88-a4df-f54a276b6364 (intptr,intptr) at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5341) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641) at dalvik.system.NativeStart.main(Native Method)
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
@sbonello Thanks. My code is from the sample like that. The only difference is that I create a copy of the media stream because xamarin thankfully disposes the stream when loaded with ImageSource.FromStream and I need the stream for upload afterwards to the image preview.
Yes, this is different then what was reported, so would be a different bug, so I suggest opening a new one and reporting what version of the plugin you are using with the info you put on there.