Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterless constructor error in iOS #124

Open
AnilKakaraG1 opened this issue Jan 4, 2025 · 3 comments
Open

Parameterless constructor error in iOS #124

AnilKakaraG1 opened this issue Jan 4, 2025 · 3 comments

Comments

@AnilKakaraG1
Copy link

Clearly I'm doing something wrong. Whenever I load a XAML page that has the CameraView in iOS I get a crash with, "No parameterless constructor defined for type BarcodeScanning.CameraView" I have the latest version of the library (2.1.3).

<scanner:CameraView HeightRequest="400" OnDetectionFinished="CameraView_OnDetectionFinished" />

@Domik234
Copy link

Hey, I've tried the .NET 8 + BarcodeScanning v.1.7.4 and the same happened.

At start I've replaced the XAML construction with C# construction that made this one exception disappear but when I've continued with testing - it crashed after some tries of constructing page with scanner (randomly from 2nd to 9th construction of page with CameraView).

I've moved back to 1.5.9 where these complications have not existed.

@afriscic
Copy link
Owner

Please try to clone the Test project and try with it to see if the problem persists

@Domik234
Copy link

Hello @afriscic,
test project on iOS appears to work and XamlParseException is not happening there on both .NET versions (will have to look on later why this happens).

But opening the ScanPage crashes on second time with both (1.7.4 - NET8, 2.1.4 - NET9) leads to crash:

**System.ObjectDisposedException:** 'Cannot access a disposed object.
Object name: 'AVFoundation.AVCaptureDevice'.'

ScanTab can be visited repeatedly. Maybe there is disposing of shared resources when disconnecting handler on page disappearing/unloading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants