Unable to Start app on Kobiton devices but it works sometimes NullPointerException Cannot invoke getHeight because getStatusBar is null

Hi, I’m getting Unable to Start app on Kobiton devices but App does start sometimes. Using KS version 9.0, Appium v1.17.1

I’ve setup the KS/Kobiton integration and tested the connection successfully.

When I run my script and select to Run on a Kobiton device and select a device from the list I am getting a Unable to Start App and the issue is caused by NullPointerException. Even though this fails the Kobiton device loads the app.

Here is the error:

2023-11-28 15:35:26.361 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2023-11-28 15:35:26.363 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/Testing/Verify Android Container Login
2023-11-28 15:35:26.538 INFO  c.k.katalon.core.main.TestCaseExecutor   - (Default) userName = xatjason
2023-11-28 15:35:26.555 INFO  c.k.katalon.core.main.TestCaseExecutor   - (Default) password = Pass1234
2023-11-28 15:35:26.810 DEBUG testcase.Verify Android Container Login  - 1: startApplication("kobiton-store:v649804", false)
Nov 28, 2023 3:35:38 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
INFO: Detected dialect: OSS
2023-11-28 15:35:39.645 INFO  c.k.k.c.a.driver.AppiumRequestService    - appiumVersion = 1.17.1
2023-11-28 15:35:39.646 INFO  c.k.k.c.a.driver.AppiumRequestService    - appiumServerStatus = {"status":0,"value":{"build":{"version":"1.17.1","revision":"15ca429a421b13e0fb90b3516c61f6dc9da0c9c6"}},"sessionId":null}
2023-11-28 15:35:39.748 INFO  c.k.k.c.a.driver.AppiumDriverManager     - remoteDriverUrl = https://myUsername:myApiKey@api.kobiton.com/wd/hub
2023-11-28 15:35:39.750 INFO  c.k.k.c.a.driver.AppiumDriverManager     - desiredCapabilities = {
  "app": "kobiton-store:v649804",
  "acceptSslCerts": true,
  "sessionDescription": "",
  "platformVersion": "14",
  "sessionName": "Automation test session",
  "captureSreenShots": true,
  "browserName": "chrome",
  "deviceOrientation": "portrait",
  "platformName": "Android",
  "deviceName": "Pixel 8"
}
2023-11-28 15:35:41.254 ERROR c.k.k.core.keyword.internal.KeywordMain  - ❌ Unable to start app at: 'kobiton-store:v649804' (Root cause: java.lang.NullPointerException: Cannot invoke "com.kms.katalon.core.mobile.helper.OSBarProperties.getHeight()" because the return value of "com.kms.katalon.core.mobile.helper.AndroidSystemBarProperties.getStatusBar()" is null
	at com.kms.katalon.core.mobile.helper.AndroidHelper.getStatusBarByProperty(AndroidHelper.java:42)
	at com.kms.katalon.core.mobile.helper.AndroidHelper.getStatusBarHeightAndroid(AndroidHelper.java:25)
	at com.kms.katalon.core.mobile.helper.MobileCommonHelper.getStatusBarHeight(MobileCommonHelper.java:191)
	at com.kms.katalon.core.mobile.helper.MobileCommonHelper.setCommonAppiumSessionProperties(MobileCommonHelper.java:209)
	at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startMobileDriver(MobileDriverFactory.java:486)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.doCall(StartApplicationKeyword.groovy:61)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.call(StartApplicationKeyword.groovy)
	at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.startApplication(StartApplicationKeyword.groovy:63)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.execute(StartApplicationKeyword.groovy:42)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startApplication(MobileBuiltInKeywords.groovy:78)
	at Verify Android Container Login.run(Verify Android Container Login:56)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at TempTestCase1701203722945.run(TempTestCase1701203722945.groovy:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
)
2023-11-28 15:35:41.258 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/Testing/Verify Android Container Login FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to start app at: 'kobiton-store:v649804' (Root cause: java.lang.NullPointerException: Cannot invoke "com.kms.katalon.core.mobile.helper.OSBarProperties.getHeight()" because the return value of "com.kms.katalon.core.mobile.helper.AndroidSystemBarProperties.getStatusBar()" is null
	at com.kms.katalon.core.mobile.helper.AndroidHelper.getStatusBarByProperty(AndroidHelper.java:42)
	at com.kms.katalon.core.mobile.helper.AndroidHelper.getStatusBarHeightAndroid(AndroidHelper.java:25)
	at com.kms.katalon.core.mobile.helper.MobileCommonHelper.getStatusBarHeight(MobileCommonHelper.java:191)
	at com.kms.katalon.core.mobile.helper.MobileCommonHelper.setCommonAppiumSessionProperties(MobileCommonHelper.java:209)
	at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startMobileDriver(MobileDriverFactory.java:486)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.doCall(StartApplicationKeyword.groovy:61)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.call(StartApplicationKeyword.groovy)
	at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.startApplication(StartApplicationKeyword.groovy:63)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.execute(StartApplicationKeyword.groovy:42)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startApplication(MobileBuiltInKeywords.groovy:78)
	at Verify Android Container Login.run(Verify Android Container Login:56)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at TempTestCase1701203722945.run(TempTestCase1701203722945.groovy:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
)
	at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:51)
	at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.stepFailed(MobileKeywordMain.groovy:40)
	at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:23)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.startApplication(StartApplicationKeyword.groovy:63)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.execute(StartApplicationKeyword.groovy:42)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startApplication(MobileBuiltInKeywords.groovy:78)
	at Verify Android Container Login.run(Verify Android Container Login:56)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at TempTestCase1701203722945.run(TempTestCase1701203722945.groovy:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: java.lang.NullPointerException: Cannot invoke "com.kms.katalon.core.mobile.helper.OSBarProperties.getHeight()" because the return value of "com.kms.katalon.core.mobile.helper.AndroidSystemBarProperties.getStatusBar()" is null
	at com.kms.katalon.core.mobile.helper.AndroidHelper.getStatusBarByProperty(AndroidHelper.java:42)
	at com.kms.katalon.core.mobile.helper.AndroidHelper.getStatusBarHeightAndroid(AndroidHelper.java:25)
	at com.kms.katalon.core.mobile.helper.MobileCommonHelper.getStatusBarHeight(MobileCommonHelper.java:191)
	at com.kms.katalon.core.mobile.helper.MobileCommonHelper.setCommonAppiumSessionProperties(MobileCommonHelper.java:209)
	at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startMobileDriver(MobileDriverFactory.java:486)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.doCall(StartApplicationKeyword.groovy:61)
	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.call(StartApplicationKeyword.groovy)
	at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
	... 18 more

2023-11-28 15:35:41.262 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/Testing/Verify Android Container Login

Here is an example of the failure:

Here is an example of the app starting and objects being seen

2 Likes

Hi,

I will ask my team for further support

1 Like

Hi @mlbfan10 ,

                 Looks like you are able to execute with 1st device successfully, however i can see other devices you need to select in the select device popup, that's why it's failed for those devices

Regards
Vinayak

Hi, @vinayak_joshi1 thanks for response. The images are just to show the integration with Kobiton is working and that it’s failing when I try to run on a device from the Kobiton device dropdown. After selecting a device it fails except for a couple Android V10 phones that work when selected from the dropdown which is what the second screenshot is trying to show.