Mac problem with libopencv_java342.dylib loaded, but it might be a problem OpenCV

Asked by Ana Vukovic

Hi
I want to integrate sikulix framework in my java selenium project

this is my configuration:

os.arch = aarch64
os.name = Mac OS X
os.version = 13.0.1
sun.boot.library.path = /Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home/lib

 </dependency>
        <!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
            <dependency>
                <groupId>com.sikulix</groupId>
                <artifactId>sikulixapi</artifactId>
                <version>2.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
 <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.4.0</version>
        </dependency>
        <dependency>

I installed OPENCV with command: brew install opncv (opencv4)
 and
 brew install tesseract-lang
I allowed all permissions

My error when I run method: screen.hover("/Users/a.vukovic/accept.png");

[error] RunTime:Problematic lib: /Users/a.vukovic/Library/Application Support/Sikulix/SikulixLibs/libopencv_java342.dylib (...TEMP...)
[error] RunTime:libopencv_java342.dylib loaded, but it might be a problem with needed dependent libraries
ERROR: Can't load library: ...TEMP...
Exception in thread "main" java.lang.ExceptionInInitializerError
 at org.sikuli.script.Finder$FindInput2.<clinit>(Finder.java:1210)
 at org.sikuli.script.Finder.<init>(Finder.java:36)
 at org.sikuli.script.Region.doCheckLastSeenAndCreateFinder(Region.java:2951)
 at org.sikuli.script.Region.checkLastSeenAndCreateFinder(Region.java:2912)
 at org.sikuli.script.Region.doFind(Region.java:2839)
 at org.sikuli.script.Region.access$300(Region.java:23)
 at org.sikuli.script.Region$RepeatableFind.run(Region.java:3122)
 at org.sikuli.script.Region$Repeatable.repeat(Region.java:3073)
 at org.sikuli.script.Region.wait(Region.java:2258)
 at org.sikuli.script.Region.wait(Region.java:2302)
 at org.sikuli.script.Region.getLocationFromTarget(Region.java:3329)
 at org.sikuli.script.Region.mouseMove(Region.java:4275)
 at org.sikuli.script.Region.hover(Region.java:3930)
 at SeleniumSikuli.main(SeleniumSikuli.java:66)
Caused by: org.sikuli.script.SikuliXception: problem with native library: libopencv_java342.dylib
 at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1462)
 at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1619)
 at org.sikuli.script.Finder$Finder2.<clinit>(Finder.java:571)
 ... 14 more

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Anshul Harinkhere
Solved:
Last query:
Last reply:
Revision history for this message
Anshul Harinkhere (anshulharinkhere123) said (last edit ):
#1
Revision history for this message
Anshul Harinkhere (anshulharinkhere123) said :
#2

Facing the same issue with the error "org.sikuli.script.SikuliXception: loadlib: libopencv_java2411.dylib not in any libs folder" Please help with the solution.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

SikuliX versions 2.0.5 and lower do not run on Mac Mx machines.

Revision history for this message
Ana Vukovic (anavuk) said :
#4

RaiMan (raimund-hocke) what verson works and how to set up Sikulix to work on Mac?

Revision history for this message
Best Anshul Harinkhere (anshulharinkhere123) said :
#5

Ana Vukovic using 2.6.0-snapshot worked for me by replacing and renaming the jar into 2.5.0 folder inside .m2 repo folder.

Steps

1. Download the Jar file of 2.6.0-snapshot from https://github.com/RaiMan/SikuliX1.
2. And inside .m2>SikuliX 2.5.0 folder delete the 2.5.0 jar file and rename the downloaded file name into 2.5.0 jar file name.

Revision history for this message
RaiMan (raimund-hocke) said :
#6

@Anshul: Would be safer for the future, to change the ref in the pom-file to 2.0.6-snapshot, but you still have to manually add the version 2.0.6-snapshot to your local .m2 repo.
But thanks anyway

Revision history for this message
Ana Vukovic (anavuk) said (last edit ):
#7
Revision history for this message
Ana Vukovic (anavuk) said :
#8

Thanks Anshul Harinkhere, that solved my question.