BarcodeScanner
BarcodeScanner copied to clipboard
System.ArgumentException: Page to remove must be contained on this Navigation Page
Hello,
when i use the ContentPageBarcodeScannerService to scan a barcode, i get this exception after the scan on Android:
08-15 15:43:05.903 I/MonoDroid( 1852): System.ArgumentException: Page to remove must be contained on this Navigation Page
08-15 15:43:05.903 I/MonoDroid( 1852): at Xamarin.Forms.NavigationPage.RemovePage (Xamarin.Forms.Page page) [0x00068] in D:\a\1\s\Xamarin.Forms.Core\NavigationPage.cs:399
08-15 15:43:05.903 I/MonoDroid( 1852): at Xamarin.Forms.NavigationPage+NavigationImpl.OnRemovePage (Xamarin.Forms.Page page) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\NavigationPage.cs:457
08-15 15:43:05.903 I/MonoDroid( 1852): at Xamarin.Forms.Internals.NavigationProxy.RemovePage (Xamarin.Forms.Page page) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\NavigationProxy.cs:128
An unhandled exception occured.
08-15 15:43:05.903 I/MonoDroid( 1852): at BarcodeScanner.ContentPageBarcodeScannerService+<ReadBarcodeAsync>d__12.MoveNext () [0x000f4] in <7c77e1a331d54b30b94d0530eaa61540>:0
08-15 15:43:05.903 I/MonoDroid( 1852): --- End of stack trace from previous location where exception was thrown ---
08-15 15:43:05.903 I/MonoDroid( 1852): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <43dbbdc147f2482093d8409abb04c233>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <43dbbdc147f2482093d8409abb04c233>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <43dbbdc147f2482093d8409abb04c233>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at Contoso.AwesomeApp.ViewModels.MainPageViewModel+<OnScanBarcodeCommandExecuted>d__1.MoveNext () [0x00025] in C:\Projekte\Contoso.AwesomeApp\src\Contoso.AwesomeApp\ViewModels\MainPageViewModel.cs:36
08-15 15:43:05.903 I/MonoDroid( 1852): --- End of stack trace from previous location where exception was thrown ---
08-15 15:43:05.903 I/MonoDroid( 1852): at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <741431b783734664a2b36cbf4a21ca73>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <741431b783734664a2b36cbf4a21ca73>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <741431b783734664a2b36cbf4a21ca73>:0
08-15 15:43:05.903 I/MonoDroid( 1852): at (wrapper dynamic-method) System.Object.36(intptr,intptr)
I also get this exception when i hit the hardware back button on an android device.
What can i do to resolve this error?
Regards, Dirk
This sounds like a bug with the ContentPage version... I'll have to investigate this... in the mean time I might suggest using the PopupPage version
I am having same issue with using content page