afriscic / BarcodeScanning.Native.Maui

Barcode scanning library for .NET MAUI
https://www.nuget.org/packages/BarcodeScanning.Native.Maui
MIT License
183 stars 33 forks source link

Black CameraView in UNO / MAUI mobile project (Android) #86

Open DomagojJugovich opened 2 months ago

DomagojJugovich commented 2 months ago

Hi I tried many free and commercial barcode scanning libs in my UNO Platform project. Scandit works great but I am revisiting free options. All is done as MAUI components through MAUI embedding in UNO, as newer UNO versions don't have any directly supported barcode scanning libs

CameraView component is just black allways. Any idea why ? (camera permissions are ok) There are no errors.

Mayne UNO is the problem or anything else.

image

I am using 1.5.2 version because of dll hell with UNO dependencies , so I can't use latest : image

Any ide why ? Or shoot questions for details.

Here is the log if it is any help :

am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "hr.lauscc.webossa/crc6475981dcd67117422.MainActivity" Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=hr.lauscc.webossa/crc6475981dcd67117422.MainActivity } [.lauscc.weboss] Late-enabling -Xcheck:jni [.lauscc.weboss] Unquickening 21 vdex files! [.lauscc.weboss] Unknown bits set in runtime_flags: 0x800000 [.lauscc.weboss] The ClassLoaderContext is a special shared library. [100] Open /data/app/~~3QsBEPiM3PF6gD2Dj2Y69A==/hr.lauscc.webossa-j5N-nDG81kGusHxyrebToA==/base.apk took:1.411s [Perf] Connecting to perf service. [.lauscc.weboss] [GL_OOM] ClearGrowthLimit 536870912 [NetworkSecurityConfig] No Network Security Config specified, using platform default [NetworkSecurityConfig] No Network Security Config specified, using platform default [DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c [DOTNET] GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found [monodroid] Creating public update directory: /data/user/0/hr.lauscc.webossa/files/.__override__ [.lauscc.weboss] Attempt to remove non-JNI local reference, dumping thread [monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8852,server=y,embedding=1,timeout=1723555276 Loaded assembly: System.Private.CoreLib.dll [External] [monodroid-gc] GREF GC Threshold: 46080 Loaded assembly: Inventura.dll Loaded assembly: Mono.Android.dll [External] Loaded assembly: System.Runtime.dll [External] Loaded assembly: Java.Interop.dll [External] Loaded assembly: System.Runtime.InteropServices.dll [External] Resolved pending breakpoint for 'Android.Runtime.JNIEnvInit.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnvInit.cs:57 [0x00000]. Loaded assembly: System.Collections.dll [External] Loaded assembly: Mono.Android.Runtime.dll [External] Loaded assembly: System.Threading.dll [External] Loaded assembly: System.Threading.Thread.dll [External] Loaded assembly: System.Diagnostics.StackTrace.dll [External] [.lauscc.weboss] Attempt to remove non-JNI local reference, dumping thread Loaded assembly: data-0x7246fe9060 [External] Loaded assembly: data-0x7246ff9070 [External] Loaded assembly: data-0x72a7018030 [External] Loaded assembly: netstandard.dll [External] Loaded assembly: System.Linq.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll Loaded assembly: System.Collections.Concurrent.dll [External] Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:423 [0x00000]. Loaded assembly: System.Text.Json.dll [External] Loaded assembly: System.Text.Encodings.Web.dll [External] Loaded assembly: System.ComponentModel.dll [External] Loaded assembly: Uno.UI.RemoteControl.dll [External] [chatty] uid=10147(hr.lauscc.webossa) identical 2 lines [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll Loaded assembly: Microsoft.Maui.Controls.dll [External] Loaded assembly: System.ObjectModel.dll [External] Loaded assembly: Microsoft.Maui.dll [External] Loaded assembly: Microsoft.Maui.Graphics.dll [External] Loaded assembly: Microsoft.Maui.Essentials.dll [External] Loaded assembly: Microsoft.Extensions.Logging.Abstractions.dll [External] Loaded assembly: System.Runtime.Loader.dll [External] Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:418 [0x00000]. Loaded assembly: Uno.UI.dll [External] Loaded assembly: System.Memory.dll [External] Loaded assembly: System.Reflection.Emit.Lightweight.dll [External] Loaded assembly: System.Reflection.Emit.ILGeneration.dll [External] Loaded assembly: System.Reflection.Primitives.dll [External] Loaded assembly: Mono.Android.Export.dll [External] Loaded assembly: System.Xml.ReaderWriter.dll [External] Loaded assembly: System.Private.Xml.dll [External] Loaded assembly: System.Reflection.Emit.dll [External] Loaded assembly: callback_factory [External] Loaded assembly: System.Collections.NonGeneric.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll Loaded assembly: Xamarin.AndroidX.Core.dll [External] Loaded assembly: Uno.Diagnostics.Eventing.dll [External] Loaded assembly: Uno.Foundation.dll [External] Loaded assembly: Uno.Foundation.Logging.dll [External] Loaded assembly: Uno.dll [External] Loaded assembly: Uno.UI.Composition.dll [External] Loaded assembly: Uno.UI.BindingHelper.Android.dll [External] Loaded assembly: Microsoft.Extensions.Hosting.Abstractions.dll [External] Loaded assembly: Uno.UI.Dispatching.dll [External] Loaded assembly: System.Numerics.Vectors.dll [External] Loaded assembly: System.Private.Uri.dll [External] Loaded assembly: System.Text.RegularExpressions.dll [External] Loaded assembly: System.Collections.Immutable.dll [External] Loaded assembly: System.Console.dll [External] Loaded assembly: Uno.UI.RemoteControl.Messaging.dll [External] Loaded assembly: Uno.Extensions.Configuration.dll [External] Loaded assembly: Microsoft.Extensions.DependencyInjection.Abstractions.dll [External] Loaded assembly: Uno.UI.FluentTheme.v2.dll [External] Loaded assembly: Uno.Toolkit.WinUI.Material.dll [External] [.lauscc.weboss] WaitForGcToComplete blocked RunEmptyCheckpoint on ProfileSaver for 19.631ms Loaded assembly: System.Net.WebSockets.dll [External] Loaded assembly: System.Net.WebSockets.Client.dll [External] Loaded assembly: System.Net.Http.dll [External] Loaded assembly: System.Net.Primitives.dll [External] Loaded assembly: System.Net.Security.dll [External] Loaded assembly: System.Security.Cryptography.dll [External] Loaded assembly: System.Net.WebHeaderCollection.dll [External] Loaded assembly: System.Collections.Specialized.dll [External] Loaded assembly: Microsoft.Win32.Primitives.dll [External] Loaded assembly: System.Diagnostics.DiagnosticSource.dll [External] Loaded assembly: System.Diagnostics.Tracing.dll [External] Loaded assembly: System.Net.Quic.dll [External] Loaded assembly: System.Threading.Channels.dll [External] Thread started: #2 Thread started: .NET TP Gate #3 Thread started: #4 Loaded assembly: System.Net.Sockets.dll [External] Loaded assembly: System.Runtime.Intrinsics.dll [External] Thread started: #5 Thread started: #6 Loaded assembly: System.Threading.ThreadPool.dll [External] Thread started: #7 Thread started: #8 Thread started: #9 Thread started: .NET Sockets #10 Thread started: #11 Loaded assembly: System.Net.NameResolution.dll [External] Thread started: .NET Timer #12 Loaded assembly: SkiaSharp.Views.Windows.dll [External] Loaded assembly: Uno.Extensions.Core.UI.dll [External] Loaded assembly: Uno.Extensions.Hosting.WinUI.dll [External] Loaded assembly: Uno.Extensions.Http.WinUI.dll [External] Loaded assembly: Uno.Extensions.Localization.WinUI.dll [External] Loaded assembly: Uno.Extensions.Logging.WinUI.dll [External] Loaded assembly: Uno.Extensions.Maui.WinUI.dll [External] Loaded assembly: Uno.Extensions.Storage.UI.dll [External] Loaded assembly: Uno.Material.WinUI.dll [External] Loaded assembly: Uno.Themes.WinUI.dll [External] Loaded assembly: Uno.Toolkit.WinUI.dll [External] Loaded assembly: Uno.UI.Lottie.dll [External] Loaded assembly: Uno.UI.Toolkit.dll [External] Loaded assembly: Uno.UI.FluentTheme.dll [External] Loaded assembly: Uno.UI.FluentTheme.v1.dll [External] Loaded assembly: Xamarin.AndroidX.ViewPager.dll [External] Loaded assembly: Xamarin.AndroidX.Fragment.dll [External] Loaded assembly: Xamarin.AndroidX.SwipeRefreshLayout.dll [External] Loaded assembly: Uno.Core.Extensions.Disposables.dll [External] Loaded assembly: Xamarin.AndroidX.Core.SplashScreen.dll [External] Loaded assembly: SkiaSharp.Skottie.dll [External] Loaded assembly: SkiaSharp.dll [External] Loaded assembly: SkiaSharp.SceneGraph.dll [External] Loaded assembly: UniversalImageLoader.dll [External] Loaded assembly: System.Drawing.Primitives.dll [External] [Config:Grabber:OnePlusFontConfig] Index 0 requested, with a size of 0 [309] package:hr.lauscc.webossa took:10397 calssname:android.app.ActivityThread$H callback:null what:110 [.lauscc.weboss] [frame_perf] perfboost open tb_ctl file failed, isApp[1], errno=No such file or directory [libprocessgroup] set_timerslack_ns write failed: Operation not permitted Loaded assembly: Xamarin.AndroidX.AppCompat.dll [External] Loaded assembly: Xamarin.AndroidX.Activity.dll [External] Loaded assembly: Xamarin.AndroidX.Lifecycle.Common.dll [External] Loaded assembly: Xamarin.AndroidX.Lifecycle.ViewModel.dll [External] Loaded assembly: Xamarin.AndroidX.SavedState.dll [External] Loaded assembly: Xamarin.AndroidX.DrawerLayout.dll [External] Loaded assembly: Xamarin.AndroidX.CustomView.dll [External] Loaded assembly: Xamarin.AndroidX.Loader.dll [External] [AppCompatDelegate] Checking for metadata for AppLocalesMetadataHolderService : Service not found Loaded assembly: Xamarin.AndroidX.Lifecycle.Runtime.dll [External] [System] A resource failed to call close. Resolved pending breakpoint at 'App.xaml.cs:178,1' to void Inventura.App.d18.MoveNext () [0x000ad]. Resolved pending breakpoint at 'App.xaml.cs:182,1' to void Inventura.App.d__18.MoveNext () [0x000d0]. Loaded assembly: Inventura.MauiControls.dll Loaded assembly: Uno.Core.Extensions.Logging.Singleton.dll [External] Loaded assembly: Uno.Core.Extensions.Logging.dll [External] Loaded assembly: Microsoft.Extensions.Configuration.Abstractions.dll [External] Loaded assembly: Microsoft.Extensions.Hosting.dll [External] Loaded assembly: Microsoft.Extensions.FileProviders.Physical.dll [External] Loaded assembly: Microsoft.Extensions.FileProviders.Abstractions.dll [External] Loaded assembly: Microsoft.Extensions.DependencyInjection.dll [External] Loaded assembly: Microsoft.Extensions.Logging.dll [External] Loaded assembly: Uno.Extensions.Serialization.dll [External] Loaded assembly: Uno.Extensions.Hosting.dll [External] Loaded assembly: Uno.Extensions.Core.dll [External] Loaded assembly: Uno.Extensions.Storage.dll [External] Loaded assembly: Microsoft.Extensions.Configuration.dll [External] Loaded assembly: Microsoft.Maui.Controls.Compatibility.dll [External] Loaded assembly: Microsoft.Maui.Controls.Xaml.dll [External] Loaded assembly: Xamarin.Google.Android.Material.dll [External] Loaded assembly: System.ComponentModel.TypeConverter.dll [External] Loaded assembly: Xamarin.AndroidX.Navigation.Runtime.dll [External] Loaded assembly: BarcodeScanning.Native.Maui.dll [External] Loaded assembly: Uno.Extensions.Localization.dll [External] Loaded assembly: Microsoft.Extensions.Configuration.EnvironmentVariables.dll [External] Loaded assembly: Microsoft.Extensions.Configuration.CommandLine.dll [External] Loaded assembly: Microsoft.Extensions.Primitives.dll [External] Loaded assembly: Microsoft.Extensions.Configuration.FileExtensions.dll [External] Loaded assembly: Microsoft.Extensions.Configuration.Json.dll [External] Loaded assembly: System.Text.Encoding.Extensions.dll [External] Loaded assembly: Microsoft.Extensions.Options.dll [External] Loaded assembly: Microsoft.Extensions.Logging.Configuration.dll [External] Loaded assembly: Microsoft.Extensions.Options.ConfigurationExtensions.dll [External] Loaded assembly: Microsoft.Extensions.Configuration.Binder.dll [External] Loaded assembly: System.Threading.Tasks.Extensions.dll [External] Loaded assembly: Microsoft.Extensions.Localization.Abstractions.dll [External] Loaded assembly: Uno.Extensions.Serialization.Refit.dll [External] Loaded assembly: Refit.dll [External] Loaded assembly: Uno.Core.Extensions.Collections.dll [External] Thread started: #13 Thread started: #14 Thread started: #15 Loaded assembly: System.Runtime.Serialization.Json.dll [External] Loaded assembly: System.Private.DataContractSerialization.dll [External] Loaded assembly: System.Runtime.Serialization.Xml.dll [External] Loaded assembly: System.Runtime.Serialization.Primitives.dll [External] Loaded assembly: Xamarin.AndroidX.RecyclerView.dll [External] Loaded assembly: Xamarin.AndroidX.CardView.dll [External] Loaded assembly: Xamarin.AndroidX.CoordinatorLayout.dll [External] Loaded assembly: System.ComponentModel.Primitives.dll [External] [.lauscc.weboss] Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) [.lauscc.weboss] Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) Loaded assembly: CommunityToolkit.Mvvm.dll [External] [memtrack] Couldn't load memtrack module Loaded assembly: System.Linq.Expressions.dll [External] Loaded assembly: CommonServiceLocator.dll [External] [.lauscc.weboss] Accessing hidden method Landroid/view/View;->initializeScrollbars(Landroid/content/res/TypedArray;)V (greylist, JNI, allowed) Loaded assembly: Newtonsoft.Json.dll [External] [OPFD_Manager] Dark? false, OP Force ? false [ViewRootImpl] The specified message queue synchronization barrier token has not been posted or has already been removed [ViewRootImpl] support adaptive color gamut feature! [309] package:hr.lauscc.webossa took:15808 calssname:android.app.ActivityThread$H callback:null what:159 [SensorManager] registerListenerImpl sensorName:gravity Non-wakeup,isWakeUpSensor:false,callingApp: hr.lauscc.webossa,callingPid:31968,callingUid:10147 [SensorManager] registerListenerImpl sensorName:gravity Non-wakeup,isWakeUpSensor:false,callingApp: hr.lauscc.webossa,callingPid:31968,callingUid:10147 [ViewRootImpl] The specified message queue synchronization barrier token has not been posted or has already been removed [ViewRootImpl] The specified message queue synchronization barrier token has not been posted or has already been removed Loaded assembly: System.Runtime.Numerics.dll [External] Thread started: #16 [.lauscc.weboss] Accessing hidden field Landroid/widget/TextView;->mEditor:Landroid/widget/Editor; (greylist, reflection, allowed) [.lauscc.weboss] Explicit concurrent copying GC freed 3550(328KB) AllocSpace objects, 3(60KB) LOS objects, 49% free, 4605KB/9210KB, paused 39us total 11.514ms [AdrenoGLES-0] QUALCOMM build : 8e5405b, I57aaec3440 [AdrenoGLES-0] Build Date : 05/21/21 [AdrenoGLES-0] OpenGL ES Shader Compiler Version: EV031.32.02.10 [AdrenoGLES-0] Local Branch : mybranchebba1dbe-451b-f160-ac81-1458d0b52ae8 [AdrenoGLES-0] Remote Branch : quic/gfx-adreno.lnx.1.0.r135-rel [AdrenoGLES-0] Remote Branch : NONE [AdrenoGLES-0] Reconstruct Branch : NOTHING [AdrenoGLES-0] Build Config : S P 10.0.7 AArch64 [AdrenoGLES-0] Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so [AdrenoGLES-0] PFP: 0x016ee190, ME: 0x00000000 [View] requestLayout() improperly called by Microsoft.UI.Xaml.Shapes.Ellipse during layout: running second layout pass [View] requestLayout() improperly called by Microsoft.UI.Xaml.Shapes.Ellipse during layout: running second layout pass [Gralloc4] mapper 4.x is not supported [Gralloc3] mapper 3.x is not supported [OpenGLRenderer] Davey! duration=1738ms; Flags=1, IntendedVsync=77319836764721, Vsync=77319836764721, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=77319836841701, AnimationStart=77319837705451, PerformTraversalsStart=77319838352326, DrawStart=77321450882117, SyncQueued=77321504561127, SyncStart=77321504960815, IssueDrawCommandsStart=77321505183210, SwapBuffers=77321572069512, FrameCompleted=77321575795554, DequeueBufferDuration=127396, QueueBufferDuration=3272864, GpuCompleted=0, [309] package:hr.lauscc.webossa took:1740 calssname:android.view.Choreographer$FrameHandler callback:null what:0 [Choreographer] Already have a pending vsync event. There should only be one at a time. [chatty] uid=10147(hr.lauscc.webossa) identical 1 line [ViewRootImpl] support adaptive color gamut feature! [Choreographer] Already have a pending vsync event. There should only be one at a time. Thread started: #17 [DecorView] onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@16d2e13[MainActivity] [ViewRootImpl[MainActivity]] windowFocusChanged hasFocus=true inTouchMode=true Thread finished: #17 The thread 17 has exited with code 0 (0x0). Loaded assembly: ScanditCaptureCoreMaui.dll [External] Resolved pending breakpoint at 'EmbeddedControl.xaml.cs:38,1' to void Inventura.MauiControls.CameraViewControl..ctor () [0x00008]. Resolved pending breakpoint at 'EmbeddedControl.xaml.cs:194,1' to void Inventura.MauiControls.CameraViewControl.CameraView_OnDetectionFinished (object sender, BarcodeScanning.OnDetectionFinishedEventArg e) [0x00001]. Resolved pending breakpoint at 'EmbeddedControl.xaml.cs:68,1' to void Inventura.MauiControls.CameraViewControl.d6.MoveNext () [0x0001a]. Loaded assembly: Xamarin.AndroidX.Camera.Core.dll [External] Loaded assembly: Xamarin.GooglePlayServices.MLKit.BarcodeScanning.dll [External] Loaded assembly: Xamarin.GooglePlayServices.Base.dll [External] Loaded assembly: Xamarin.Google.MLKit.Vision.Interfaces.dll [External] Loaded assembly: Xamarin.AndroidX.Camera.View.dll [External] Loaded assembly: Xamarin.AndroidX.Lifecycle.LiveData.Core.dll [External] [CameraManagerGlobal] Connecting to camera service [CamLifecycleController] Lifecycle is not set. [CameraController] Use cases not attached to camera. [CameraManagerGlobal] [soar.cts] ignore the status update of camera: 2 [CameraManagerGlobal] [soar.cts] ignore the status update of camera: 3 Loaded assembly: Xamarin.AndroidX.Lifecycle.LiveData.dll [External] [CameraRepository] Added camera: 0 [SensorManager] registerListenerImpl sensorName:lsm6ds3c Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: hr.lauscc.webossa,callingPid:31968,callingUid:10147 [Camera2CameraInfo] Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL [CameraRepository] Added camera: 1 [Camera2CameraInfo] Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED [CameraValidator] Verifying camera lens facing on OnePlus6T, lensFacingInteger: null Loaded assembly: System.Threading.Tasks.Parallel.dll [External] [CamLifecycleController] Lifecycle is not set. [CameraController] Use cases not attached to camera. [sqlite3_android] [IKR-38846] ONEPLUS_NAME_PARTS_MATCH SQLITE_OK [DynamiteModule] Considering local module com.google.mlkit.dynamite.barcode:10000 and remote module com.google.mlkit.dynamite.barcode:0 [DynamiteModule] Selected local version of com.google.mlkit.dynamite.barcode Loaded assembly: Xamarin.Google.MLKit.Vision.Common.dll [External] [TetheringManager] registerTetheringEventCallback:hr.lauscc.webossa Loaded assembly: Xamarin.GooglePlayServices.Tasks.dll [External] Loaded assembly: Xamarin.Google.MLKit.Common.dll [External] Loaded assembly: Xamarin.Google.Android.ODML.Image.dll [External] Loaded assembly: Xamarin.GooglePlayServices.Basement.dll [External] Loaded assembly: Xamarin.Google.Guava.ListenableFuture.dll [External] [SensorManager] registerListenerImpl sensorName:lsm6ds3c Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: hr.lauscc.webossa,callingPid:31968,callingUid:10147 [CamLifecycleController] Lifecycle is not set. [CameraController] Use cases not attached to camera. [CamLifecycleController] Lifecycle is not set. [CameraController] Use cases not attached to camera. [ProfileInstaller] Installing profile for hr.lauscc.webossa Loaded assembly: System.Xml.XmlSerializer.dll [External] Thread started: #18 Thread started: #19 [libc] Requested dump for tid 31968 (.lauscc.webossa)

philippnies commented 2 months ago

I have the same problem. According to the log, the camera is restarted continuously because the dimensions have been adjusted.

I/EmulatedCamera3_QemuSensor( 1431): captureNV21: Dimensions for the current request (1280x720) differ from the previous request (1280x960). Restarting camera

rockit666 commented 4 weeks ago

I have the same problem too. I tried it with the CameraView of the community toolkit. This works..

afriscic commented 4 weeks ago

Sorry, I don't have any experience with UNO...

rockit666 commented 3 weeks ago

I found a Solution for me. It sounds weird, but it looks like a render issue. I had the camera view in a ScrollView. It worked after replacing with a StackLayout

varuncogg commented 3 weeks ago

Any chance of some more hint on the fix. Camera doesn't render on the screen. Not sure what is happening when i navigates to the page second time @afriscic . First time the page loads correctly and the second load the page doesn't load the camera. I checked the handler it is initialized. Not sure why the rendering is not happening @rockit666 Can you please help if you have any finding. Stackpanel didn't fix it. Thanks in advance.

afriscic commented 3 weeks ago

This looks to me like a Handler issue. Try not to call DisconnectHandler()

The thing is if a page is transient (new page gets created on each navigation) then you need to call DisconnectHandler() to prevent memory leaks. But if your previous instance of a page gets reused on navigation, than calling DisconnectHandler() would dispose the Handler instance and you won't have anything to connect to on second page navigation.

rockit666 commented 3 weeks ago

Well, I use a singleton page and it works. services.AddSingleton<ScanQrCodePage>();

varuncogg commented 3 weeks ago

Thanks. When I reading through your issues I also read a comment very similar to this again special thanks for that to route me to issue. I had to comment few lines in lib to make it working the Android CameraManager Dispose was causing these issues. I suppose whenever we are removing those camerapages it was calling disconnect handler and that dispose call caused the issue when it reinitialises second time. So I just commented the Executor and scanner interface dispose methods temporarily to see, that fixes the issue. Creating a singleton Page and reusing it will solve the problem - solution works. Thanks @rockit666 @afriscic