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

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
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
Screen scr=new Screen();
String sImagePath=ProductAreaLib.CONSTANT.DATA_PATH+"SikuliImages\\\\PCode\\\\ProgramFlow.PNG" ;;

This was the one used to work earlier but throws error as added below.
 I am using java - 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>(
 at org.sikuli.natives.WinUtil.<clinit>(
 at org.sikuli.script.Finder$Finder2.<clinit>(
 at org.sikuli.script.Finder$FindInput2.<clinit>(
 at org.sikuli.script.Finder.<init>(
 at org.sikuli.script.Region.doCheckLastSeenAndCreateFinder(
 at org.sikuli.script.Region.checkLastSeenAndCreateFinder(
 at org.sikuli.script.Region.doFind(
 at org.sikuli.script.Region.access$200(
 at org.sikuli.script.Region$
 at org.sikuli.script.Region$Repeatable.repeat(
 at org.sikuli.script.Region.exists(
 at Script.Peoplecode.Enabling_Version_Specific_PeopleCode_Compile.N02_PeopleCode_Directive_code_in_App_Engine_2xWD.testN02_PeopleCode_Directive_code_in_App_Engine_WD(
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
 at java.lang.reflect.Method.invoke(
 at junit.framework.TestCase.runTest(
 at junit.framework.TestCase.runBare(
 at junit.framework.TestResult$1.protect(
 at junit.framework.TestResult.runProtected(
 at junit.framework.TestSuite.runTest(
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

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.