Waiting up to 30000ms for UiAutomator2 to be online

Setup:
KSE 8.0.0
Windows 10, 64 bit.
node version: v14.17.0
npm version: 6.14.13
Appium v1.21.0

Hello folks,
I am getting a “Waiting up to 30000ms for UiAutomator2 to be online…” message when trying to load Katalon’s “Material Login Demo” test apk (I am seeing the same issue for any apk file I try).
https://docs.katalon.com/katalon-studio/docs/testing_mobile_apps_using_katalon_studio_kobiton.html

I’ve done a deep dive in the Katalon forum but have not found a solution for my issue; can anyone point me to a possible solution.

Thanks,
Dave

Steps to recreate:

  1. Start appium as Administrator
    -[Appium] Welcome to Appium v1.21.0
    -[Appium] Appium REST http interface listener started on 0.0.0.0:4723
  2. Start Katalon
    -Open my test mobile project with Mobile-Android Desired Capabilities:
    -appWaitActivity|String|*
    -appPackage|String|*
    -autoGrantPermissons|Boolean|true
  3. Plug-in my Android device
    -Debug mode when USB is connected is ticked
  4. Click on ‘Record Mobile’ > ‘Android Devices’
    -Device Loads
  5. Select the test apk file downloaded from Katalon resource page
    -MaterialLoginExample.apk
  6. Click ‘Start’ button
    -App loads but never goes past “Waiting up to 30000ms for UiAutomator2 to be online…” msg

Result
[35m[Appium] [39m Welcome to Appium v1.21.0
[35m[Appium] [39m Non-default server args:
[35m[Appium] [39m port: 62638
[35m[Appium] [39m loglevel: info
[35m[Appium] [39m tmpDir: C:\Users\devers\AppData\Local\Temp\Katalon\Appium\Temp1622139528576
[35m[Appium] [39m chromedriverPort: 62639
[35m[Appium] [39m Deprecated server args:
[35m[Appium] [39m [31m–chromedriver-port [39m => --default-capabilities
[35m[Appium] [39m Default capabilities, which will be added to each request unless overridden by desired capabilities:
[35m[Appium] [39m chromedriverPort: 62639
[35m[Appium] [39m Appium REST http interface listener started on 0.0.0.0:62638
[35m[HTTP] [39m [37m–> [39m [37mGET [39m [37m/wd/hub/status [39m
[35m[HTTP] [39m [90m{} [39m
[35m[HTTP] [39m [37m<-- GET /wd/hub/status [39m [32m200 [39m [90m5 ms - 68 [39m
[35m[HTTP] [39m [90m [39m
[35m[HTTP] [39m [37m–> [39m [37mGET [39m [37m/wd/hub/status [39m
[35m[HTTP] [39m [90m{} [39m
[35m[HTTP] [39m [37m<-- GET /wd/hub/status [39m [32m200 [39m [90m1 ms - 68 [39m
[35m[HTTP] [39m [90m [39m
[35m[HTTP] [39m [37m–> [39m [37mPOST [39m [37m/wd/hub/session [39m
[35m[HTTP] [39m [90m{“desiredCapabilities”:{“app”:“C:\Users\devers\Katalon_QAS_Projects\MaterialLoginExample.apk”,“appPackage”:““,“noReset”:true,“appWaitActivity”:””,“autoGrantPermissons”:true,“deviceId”:“LGH812aedca375”,“deviceName”:“LGE LG-H812 (Android 6.0)”,“fullReset”:false,“platform”:“ANDROID”,“newCommandTimeout”:1800,“platformVersion”:“6.0”,“autoGrantPermissions”:true,“platformName”:“Android”,“udid”:“LGH812aedca375”,“systemPort”:62643},“capabilities”:{“firstMatch”:[{“appium:app”:“C:\Users\devers\Katalon_QAS_Projects\MaterialLoginExample.apk”,“appium:appPackage”:““,“appium:appWaitActivity”:””,“appium:autoGrantPermissions”:true,“autoGrantPermissons”:true,“deviceId”:“LGH812aedca375”,“appium:deviceName”:“LGE LG-H812 (Android 6.0)”,“appium:fullReset”:false,“appium:newCommandTimeout”:1800,“appium:noReset”:true,“platform”:“ANDROID”,“platformName”:“android”,“appium:platformVersion”:“6.0”,“appium:systemPort”:62643,“appium:udid”:“LGH812aedca375”}]}} [39m
[35m[BaseDriver] [39m The following capabilities are not standard capabilities and should have an extension prefix:
[35m[BaseDriver] [39m autoGrantPermissons
[35m[BaseDriver] [39m deviceId
[35m[BaseDriver] [39m platform
[35m[BaseDriver] [39m chromedriverPort
[35m[Appium] [39m
[35m[Appium] [39m ======================================================================
[35m[Appium] [39m DEPRECATION WARNING:
[35m[Appium] [39m
[35m[Appium] [39m The ‘automationName’ capability was not provided in the desired
[35m[Appium] [39m capabilities for this Android session
[35m[Appium] [39m
[35m[Appium] [39m Setting ‘automationName=UiAutomator2’ by default and using the
[35m[Appium] [39m UiAutomator2 Driver
[35m[Appium] [39m
[35m[Appium] [39m The next major version of Appium (2.x) will require the
[35m[Appium] [39m ‘automationName’ capability to be set for all sessions on all
[35m[Appium] [39m platforms
[35m[Appium] [39m
[35m[Appium] [39m In previous versions (Appium <= 1.13.x), the default was
[35m[Appium] [39m ‘automationName=UiAutomator1’
[35m[Appium] [39m
[35m[Appium] [39m If you wish to use that automation instead of UiAutomator2, please
[35m[Appium] [39m add ‘automationName=UiAutomator1’ to your desired capabilities
[35m[Appium] [39m
[35m[Appium] [39m For more information about drivers, please visit
[35m[Appium] [39m Introduction - Appium and explore the
[35m[Appium] [39m ‘Drivers’ menu
[35m[Appium] [39m
[35m[Appium] [39m ======================================================================
[35m[Appium] [39m
[35m[Appium] [39m Appium v1.21.0 creating new AndroidUiautomator2Driver (v1.65.0) session
[35m[BaseDriver] [39m The following capabilities were provided, but are not recognized by Appium:
[35m[BaseDriver] [39m autoGrantPermissons
[35m[BaseDriver] [39m deviceId
[35m[BaseDriver] [39m platform
[35m[BaseDriver] [39m Session created with session id: c0777357-f863-4b19-833a-0504ccf4756d
[35m[BaseDriver] [39m Using local app ‘C:\Users\devers\Katalon_QAS_Projects\MaterialLoginExample.apk’
[35m[ADB] [39m Found 1 ‘build-tools’ folders under ‘C:\Users\devers.katalon\tools\android_sdk’ (newest first):
[35m[ADB] [39m C:/Users/devers/.katalon/tools/android_sdk/build-tools/29.0.3
[35m[ADB] [39m Using ‘adb.exe’ from ‘C:\Users\devers.katalon\tools\android_sdk\platform-tools\adb.exe’
[35m[AndroidDriver] [39m Retrieving device list
[35m[AndroidDriver] [39m Using device: LGH812aedca375
[35m[ADB] [39m Using ‘adb.exe’ from ‘C:\Users\devers.katalon\tools\android_sdk\platform-tools\adb.exe’
[35m[ADB] [39m Package name: ‘com.sourcey.materialloginexample’
[35m[ADB] [39m Main activity name: ‘com.sourcey.materiallogindemo.LoginActivity’
[35m[ADB] [39m Using ‘apksigner.jar’ from ‘C:\Users\devers.katalon\tools\android_sdk\build-tools\29.0.3\lib\apksigner.jar’
[35m[ADB] [39m ‘C:\Users\devers\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.21.1.apk’ is signed with the default certificate
[35m[ADB] [39m ‘C:\Users\devers\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’ is signed with the default certificate
[35m[UiAutomator2] [39m Server packages are not going to be (re)installed
[35m[ADB] [39m Adding packages [“io.appium.settings”,“io.appium.uiautomator2.server”,“io.appium.uiautomator2.server.test”] to Doze whitelist
[35m[ADB] [39m ‘C:\Users\devers\Katalon_QAS_Projects\MaterialLoginExample.apk’ is signed with a non-default certificate
[35m[ADB] [39m The application at ‘C:\Users\devers\Katalon_QAS_Projects\MaterialLoginExample.apk’ is already cached to ‘/data/local/tmp/appium_cache/9ddfb9f077c3cd06ce94eaef1f326ec7b76f129a.apk’
[35m[ADB] [39m The installation of ‘MaterialLoginExample.apk’ took 3255ms
[35m[UiAutomator2] [39m Starting UIAutomator2 server 4.21.1
[35m[UiAutomator2] [39m Using UIAutomator2 server from ‘C:\Users\devers\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.21.1.apk’ and test from ‘C:\Users\devers\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’
[35m[UiAutomator2] [39m Waiting up to 30000ms for UiAutomator2 to be online…

I can now load the app to my device but getting this error…
Anyone have a possible solution?

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: ‘GET /screenshot’ cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘AW0642L’, ip: ‘10.111.37.118’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.core.appium.driver.SwipeableAndroidDriver
Capabilities {app: C:\Users\devers\Katalon_QAS…, appPackage: com.hmh.api, appWaitActivity: *, autoGrantPermissions: true, chromedriverPort: 63329, databaseEnabled: false, desired: {app: C:\Users\devers\Katalon_QAS…, appWaitActivity: *, autoGrantPermissions: true, chromedriverPort: 63329, deviceId: LGH812aedca375, deviceName: LGE LG-H812 (Android 6.0), fullReset: false, newCommandTimeout: 1800, noReset: true, platform: ANDROID, platformName: android, platformVersion: 6.0, systemPort: 63333, udid: LGH812aedca375}, deviceApiLevel: 23, deviceId: LGH812aedca375, deviceManufacturer: LGE, deviceModel: LG-H812, deviceName: LGH812aedca375, deviceScreenDensity: 640, deviceScreenSize: 1440x2560, deviceUDID: LGH812aedca375, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 1800, noReset: true, pixelRatio: 4, platform: ANDROID, platformName: Android, platformVersion: 6.0, statBarHeight: 96, systemPort: 63333, takesScreenshot: true, udid: LGH812aedca375, viewportRect: {height: 2296, left: 0, top: 96, width: 1440}, warnings: {}, webStorageEnabled: false}
Session ID: 3b11193a-2fe0-42b4-85e4-fd426681857e
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.execute(SwipeableAndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:295)
at com.kms.katalon.composer.mobile.objectspy.dialog.MobileInspectorController.captureScreenshot(MobileInspectorController.java:355)
at com.kms.katalon.composer.mobile.recorder.components.MobileRecorderDialog$11.captureImage(MobileRecorderDialog.java:967)
at com.kms.katalon.composer.mobile.recorder.components.MobileRecorderDialog$11.run(MobileRecorderDialog.java:928)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

I have figured out the solution for my issue:
Press ‘Window Logo’ key
Type ‘cmd’
Right click on ‘run as admin’

-Uninstall appium: npm uninstall -g appium
-Install a known working appium version: npm install -g appium@12.1.1
-Manually removed the ‘C:\Users\username.katalon\tools\android_sdk’ folder
**Katalon will reinstall the Android SDK when ‘Project > Settings > Desired Capabilities > Mobile > Android’ link is opened from within Katalon.
-Removed all Desired Capabilities