Vision class missing in sikulixapi-2.0.4.jar

Asked by Selva on 2020-03-23

we used old sikulixapi.jar for longtime and forced to use the latest own.
 While importing the latest jar - sikulixapi-2.0.4.jar, we face issue on the following

import org.sikuli.natives.Vision;

This Vision is used as
Vision.setParameter("MinTargetSize", 18);

with New jar - how to handle the above ?

I tried some suggestions as org.sikuli.basics.proxies.Vison which does not exist

Please suggest the right one

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-03-24
Last query:
2020-03-24
Last reply:
2020-03-23
Best RaiMan (raimund-hocke) said : #1

A class Vision does no longer exist, since everything OpenCV related is now implemented at the Java level.

The above feature does not make sense anyways anymore with the current implementation.

So simply purge it.

Selva (ganapathy-selva) said : #2

Hi RaiMan,
Thanks for the update. I have commnted out the above feature. But I am having issue on just simple click on screen image
like
Screen scr=new Screen();
String sImagePath=ProductAreaLib.CONSTANT.DATA_PATH+"SikuliImages\\\\PCode\\\\ProgramFlow.PNG" ;
scr.click(sImagePath);

This was the one used to work earlier but throws error as added below.
 I am using java 1.8.0.241 - and sikulixapi-2.0.4.jar
Is there any change in latest version and also any document to provide java coding on scree based, click, DoubleClick, exists where the sImagePath is path of png image
--
java.lang.NoSuchMethodError: com.sun.jna.Native.load(Ljava/lang/String;Ljava/lang/Class;Ljava/util/Map;)Lcom/sun/jna/Library;
 at org.sikuli.natives.SXUser32.<clinit>(SXUser32.java:13)
 at org.sikuli.natives.WinUtil.<clinit>(WinUtil.java:495)
 at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1717)
 at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1660)
 at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1479)
 at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1689)
 at org.sikuli.script.Finder$Finder2.<clinit>(Finder.java:536)
 at org.sikuli.script.Finder$FindInput2.<clinit>(Finder.java:1164)
 at org.sikuli.script.Finder.<init>(Finder.java:34)
 at org.sikuli.script.Region.doCheckLastSeenAndCreateFinder(Region.java:2841)
 at org.sikuli.script.Region.checkLastSeenAndCreateFinder(Region.java:2802)
 at org.sikuli.script.Region.doFind(Region.java:2731)
 at org.sikuli.script.Region.access$200(Region.java:28)
 at org.sikuli.script.Region$RepeatableFind.run(Region.java:2983)
 at org.sikuli.script.Region$Repeatable.repeat(Region.java:2926)
 at org.sikuli.script.Region.exists(Region.java:2322)
 at Script.Peoplecode.Enabling_Version_Specific_PeopleCode_Compile.N02_PeopleCode_Directive_code_in_App_Engine_2xWD.testN02_PeopleCode_Directive_code_in_App_Engine_WD(N02_PeopleCode_Directive_code_in_App_Engine_2xWD.java:95)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at junit.framework.TestCase.runTest(TestCase.java:168)
 at junit.framework.TestCase.runBare(TestCase.java:134)
 at junit.framework.TestResult$1.protect(TestResult.java:110)
 at junit.framework.TestResult.runProtected(TestResult.java:128)
 at junit.framework.TestResult.run(TestResult.java:113)
 at junit.framework.TestCase.run(TestCase.java:124)
 at junit.framework.TestSuite.runTest(TestSuite.java:243)
 at junit.framework.TestSuite.run(TestSuite.java:238)
 at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
---

Selva (ganapathy-selva) said : #3

I am closing this . Looks there is an issue in the order of jar in classpath. workign fine when I add this as first item in class path .

Selva (ganapathy-selva) said : #4

Thanks RaiMan, that solved my question.