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

DllNotFoundException OpenCvSharpExtern when running .NET MAUI on MacOS #1721

Open
LoooooKe opened this issue Nov 17, 2024 · 0 comments
Open

Comments

@LoooooKe
Copy link

LoooooKe commented Nov 17, 2024

Summary of your issue

DllNotFoundException OpenCvSharpExtern when running .NET MAUI on MacOS 15.1. If I run a simple App with Avalonia instead of MAUI everything works as intended.

I tracked the issue to

When ruuning MAUI on MacOS, IsUnix() returns False because MacCatalyst is not in the list on L188.

It should be an easy fix to add MacCatalyst to this List.

Environment

  • MacOS Sequoia 15.1, XCode 16.1
  • .NET 9
  • MAUI 9.0.0
  • OpenCvSharp4 4.10.20241108
  • OpenCvSharp4.runtime.osx_arm64 4.8.1-rc

What did you do when you faced the problem?

Generate simple MAUI App by Rider, install OpenCvSharp & osx.runtime. Somewhere initialize OpenCv (eg. VideoCapture.FromCamera). Exception occurs during initialization of OpenCvSharp.

Example code:

Console.WriteLine($"IsOSX: {RuntimeInformation.IsOSPlatform(OSPlatform.OSX)}");
Console.WriteLine($"IsMacCatalyst: {System.OperatingSystem.IsMacCatalyst()}");
Console.WriteLine($"IsLinux: {System.OperatingSystem.IsLinux()}");
cap = VideoCapture.FromCamera(0);
if(cap.IsOpened())
    Console.Out.WriteLine("Cap is opened");

Output:

2024-11-17 22:45:27.548 MauiTest[34843:374890] IsOSX: False
2024-11-17 22:45:27.548 MauiTest[34843:374890] IsMacCatalyst: True
2024-11-17 22:45:27.548 MauiTest[34843:374890] IsLinux: False

What did you intend to be?

App and VideoCapture should start without any Exceptions.

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

1 participant