[1.1.4] macOS 10.14: app.open(): throws index out of bounds exception

Asked by Katie Hanley

I have been trying to migrate some of my Sikuli scripts from High Sierra to Mojave. My scripts run without issue on HS but on Mojave I keep getting these errors that don't make any sense to me. I have attempted to install and run on multiple Mojave devices and same issue. I have tried to research these myself and am getting nowhere, any ideas?

##my sikuli script##

from sikuli import *
# -*- coding: utf-8 -*-
vision = App(r"/Applications/Vision.app")
vision.open(10)
exists("Screen Shot 2018-09-28 at 5.07.50 PM.png")
type("n", KeyModifier.CMD)
exists("1538408466683.png")
type(Pattern("1538408652774-1.png").targetOffset(-98,2), "Sikuli-iBench1")
click("1538408797939.png")
click("1538409150819.png")
click("1538408878905.png")
wait("1538409229550.png")
if exists(Pattern("1538409264021.png").similar(0.95)):
    pass
else:
    click(Pattern("1548275829946.png").targetOffset(-24,0))
    exists("1548275861794.png")
    click(Pattern("1548275886225.png").similar(0.95))
    exists(Pattern("1538409264021.png").similar(0.95))
click(Pattern("1538409635830.png").similar(0.77).targetOffset(42,1))
App.focus("Vision")
click(Pattern("1538513862157-1.png").similar(0.80).targetOffset(-40,-20), KeyModifier.ALT)

##Error Message from Mojave##
[error] script [ CreateNew ] stopped with error in line 4
[error] java.lang.ArrayIndexOutOfBoundsException ( java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 )

On High Sierra 10.13.6, I am running the latest version of SikuliX IDE 1.1.4 with JRuby (jruby-complete-9.2.0.0.jar) and Jython (jython-standalone-2.7.1.jar) both installed.
Java -version in terminal returns:
java version "11" 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)

On Mojave 10.14.1, I am running the latest version of SikuliX IDE 1.1.4 with JRuby (jruby-complete-9.2.0.0.jar) and Jython (jython-standalone-2.7.1.jar) both installed.
Java -version in terminal returns:
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Ok, apparently has something to do with vision.open(10).

 After
# -*- coding: utf-8 -*-

please add
Debug.on(3)

and run the script again.

Then post the debug output.

I guess it is somewhere in the implementation of the isRunning() feature, that is used in open(), to wait for the app to be listed in the list of running apps. I have to check.

Revision history for this message
Katie Hanley (khanley) said :
#2

[debug] RunTimeIDE: libsExport: folder exists: /Users/visionpc/Library/Application Support/Sikulix/SikulixLibs (1.1.4 - 201901160730)
[debug] RunTimeIDE: loadLib: libMacUtil.dylib (success)

[error] script [ CreateNew ] stopped with error in line 5
[error] java.lang.ArrayIndexOutOfBoundsException ( java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 )
[debug] RunTimeIDE: ***** running cleanUp *****

Revision history for this message
Katie Hanley (khanley) said :
#3

I have also tried removing these two lines:

vision = App(r"/Applications/Vision.app")
vision.open(10)

and just using:

App.focus("Vision")

But I am getting the same error.

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

Sorry for misleading.

please do:

After
# -*- coding: utf-8 -*-

please add
Debug.on(3)
App.logOn()

and run the script again.

Then post the debug output.

Revision history for this message
Katie Hanley (khanley) said :
#5

[debug] RunTimeIDE: libsExport: folder exists: /Users/visionpc/Library/Application Support/Sikulix/SikulixLibs (1.1.4 - 201901160730)
[debug] RunTimeIDE: loadLib: libMacUtil.dylib (success)
[AppLog] App.create: [-1:Vision]

[error] script [ CreateNew ] stopped with error in line 6
[error] java.lang.ArrayIndexOutOfBoundsException ( java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 )
[debug] RunTimeIDE: ***** running cleanUp *****

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

ok, thanks.

Does not shed more light on the problem situation.

I will check, where such an index-out-of-bounds error might occur.

Revision history for this message
123456789 (testok) said :
#7

Hi! Any update regarding this issue?

 I also experience the same problem using Sierra, High Sierra and Mojave in Sikuli v1.1.4

Workaround:
1. Run the ff code:
myapp = App("/Applications/TextEdit.app")
myapp.open()
2. java.lang.ArrayIndexOutOfBoundsException error occurs
3. Open Terminal
4. Run code in Step#1
5. App will open

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

This problem is fixed in the latest build (#245+).

Can you help with this problem?

Provide an answer of your own, or ask Katie Hanley for more information if necessary.

To post a message you must log in.