Unable to launch main activity error


#1

When trying to Spy or Record on Mobile Android app I keep getting the error

Unable to start application on this device. An unknown server-side error occurred while processing the command. Error occurred while starting app. Original error ‘com.webroot.security.MainActivity’ never started’ My app has an Agree & Continue screen that starts first outside of the Main Activity. The app launches to this screen but then I receive the error. Any ideas on how I can fix this?

My Devices are the Asus Zenphone V, LG G6, Nokia 6, and Google Pixel XL
Katalon Version - 5.2.0.1 and 5.3.0


#2

Here is the console output

01-26-2018 05:58:32 AM - [START] - Start Test Case : Test Cases/Android/Device Lock
01-26-2018 05:58:32 AM - [INFO] - Evaluating variables for test case
01-26-2018 05:58:32 AM - [START] - Start action : startApplication
01-26-2018 05:58:32 AM - [INFO] - Starting app at: ‘C:\Users\Jamie\OneDrive - Webroot\Webroot\Automation\Appium\consumer-free-release\consumer-free-release.apk’
01-26-2018 05:58:32 AM - [INFO] - User set preference: [‘deviceId’, ‘H8AKCX023339PKB’]
[Appium] Welcome to Appium v1.7.2
[Appium] Non-default server args:
[Appium] port: 65168
[Appium] loglevel: info
[Appium] chromeDriverPort: 65169
[Appium] tmpDir: C:\Users\Jamie\AppData\Local\Temp\Katalon\Appium\Temp1516971512832
[Appium] Appium REST http interface listener started on 0.0.0.0:65168
01-26-2018 05:58:40 AM - [INFO] - Appium server started on port 65,168
[HTTP] --> GET /wd/hub/status {}
[HTTP] <-- GET /wd/hub/status 200 13 ms - 72
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:“C:\Users\Jamie\OneDrive - Webroot\Webroot\Automation\Appium\consumer-free-release\consumer-free-release.apk”,“autoGrantPermissions”:true,“automationName”:“uiautomator2”,“deviceId”:“H8AKCX023339PKB”,“deviceName”:“asus ASUS_A006 7.0”,“fullReset”:true,“newCommandTimeout”:1800,“noReset”:false,“platform”:“ANDROID”,“platformName”:“Android”,“udid”:“H8AKCX023339PKB”},“capabilities”:{“desiredCapabilities”:{“app”:“C:\Users\Jamie\OneDrive - Webroot\Webroot\Automation\Appium\consumer-free-release\consumer-free-release.apk”,“autoGrantPermissions”:true,“automationName”:“uiautomator2”,“deviceId”:“H8AKCX023339PKB”,“deviceName”:“asus ASUS_A006 7.0”,“fullReset”:true,“newCommandTimeout”:1800,“noReset”:false,“platform”:“ANDROID”,“platformName”:“Android”,“udid”:“H8AKCX023339PKB”},“firstMatch”:[{“platformName”:“android”}]}}
[Appium] Merged W3C capabilities {“desiredCapabilities”:{“app”:"C:\Users\Jamie… into desiredCapabilities object {“app”:"C:\Users\Jamie\OneDrive - Webroot\W…
[Appium] Creating new AndroidUiautomator2Driver (v0.11.0) session
[Appium] Capabilities:
[Appium] app: C:\Users\Jamie\OneDrive - Webroot\Webroot\Automation\Appium\consumer-free-release\consumer-free-release.apk
[Appium] autoGrantPermissions: true
[Appium] automationName: uiautomator2
[Appium] deviceId: H8AKCX023339PKB
[Appium] deviceName: asus ASUS_A006 7.0
[Appium] fullReset: true
[Appium] newCommandTimeout: 1800
[Appium] noReset: false
[Appium] platform: ANDROID
[Appium] platformName: android
[Appium] udid: H8AKCX023339PKB
[BaseDriver] The following capabilities were provided, but are not recognized by appium: deviceId, platform.
[BaseDriver] Session created with session id: 1dce3fe2-9840-4f25-a1b2-4fead6ed1d96
[BaseDriver] Using local app ‘C:\Users\Jamie\OneDrive - Webroot\Webroot\Automation\Appium\consumer-free-release\consumer-free-release.apk’
[AndroidDriver] Java version is: 1.8.0_102

[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\Jamie.katalon\tools\android_sdk\platform-tools\adb.exe
[AndroidDriver] Retrieving device list
[AndroidDriver] Using device: H8AKCX023339PKB
[ADB] Checking whether adb is present
[ADB] Checking whether aapt is present
[ADB] Using aapt.exe from C:\Users\Jamie.katalon\tools\android_sdk\build-tools\27.0.3\aapt.exe
[ADB] Extracting package and launch activity from manifest
[ADB] Getting device platform version
[ADB] Checking whether aapt is present
[AndroidDriver] setDeviceLanguageCountry requires language or country.
[AndroidDriver] Got language: ‘null’ and country: ‘null’
[ADB] Checking whether aapt is present
[ADB] Checking whether aapt is present
[AndroidDriver] Screen already unlocked, doing nothing
[ADB] com.webroot.security was successfully uninstalled
[ADB] Using apksigner.bat from C:\Users\Jamie.katalon\tools\android_sdk\build-tools\27.0.3\apksigner.bat
[AndroidDriver] Remote apk path is /data/local/tmp/a8d794d08f5b0fa0e9666f6aa79ce0d4.apk
[AndroidDriver] Apk is not yet installed
[AndroidDriver] installing apk from remote
[AndroidDriver] Clearing out any existing remote apks with the same hash
[ADB] com.webroot.security was not uninstalled, because it was not present on the device
[ADB] Checking whether aapt is present
[ADB] Extracting package and launch activity from manifest
[UiAutomator2] Starting uiautomator2 server v0.3.0
[UiAutomator2] Running command: ‘adb -s H8AKCX023339PKB shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner’
[UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online…
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com.webroot.security/com.webroot.security.MainActivity’. Starting it ourselves
[ADB] com.webroot.security was successfully uninstalled
01-26-2018 05:59:51 AM - [RUN_DATA] - Logging run data ‘deviceId’ with value ‘H8AKCX023339PKB’
01-26-2018 05:59:51 AM - [RUN_DATA] - Logging run data ‘deviceName’ with value ‘asus ASUS_A006 7.0’
01-26-2018 05:59:51 AM - [RUN_DATA] - Logging run data ‘deviceModel’ with value ‘ASUS_A006’
01-26-2018 05:59:51 AM - [RUN_DATA] - Logging run data ‘deviceManufacturer’ with value ‘asus’
01-26-2018 05:59:51 AM - [RUN_DATA] - Logging run data ‘deviceOS’ with value ‘Android’
01-26-2018 05:59:51 AM - [RUN_DATA] - Logging run data ‘deviceOSVersion’ with value ‘7.0’
01-26-2018 05:59:51 AM - [FAILED] - Unable to start app at: ‘C:\Users\Jamie\OneDrive - Webroot\Webroot\Automation\Appium\consumer-free-release\consumer-free-release.apk’ (Root cause: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error occured while starting App. Original error: ‘com.webroot.security.MainActivity’ never started (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 69.68 seconds
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’
System info: host: ‘DESKTOP-BLGQ541’, ip: ‘10.8.176.27’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_102’
Driver info: driver.version: SwipeableAndroidDriver)
01-26-2018 05:59:51 AM - [END] - End action : startApplication
01-26-2018 05:59:51 AM - [FAILED] - Test Cases/Android/Device Lock FAILED because (of) Unable to start app at: ‘C:\Users\Jamie\OneDrive - Webroot\Webroot\Automation\Appium\consumer-free-release\consumer-free-release.apk’ (Root cause: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error occured while starting App. Original error: ‘com.webroot.security.MainActivity’ never started (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 69.68 seconds
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’
System info: host: ‘DESKTOP-BLGQ541’, ip: ‘10.8.176.27’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_102’
Driver info: driver.version: SwipeableAndroidDriver)
01-26-2018 05:59:51 AM - [END] - End Test Case : Test Cases/Android/Device Lock


#3

Hi Katalon Team,

I am also getting the same error. Can you please check any fix for it

Thanks


#4

Hi there!! Also i have this problem when trying to spy my mobile phone for testing. Appium is installed but this problems occurs allways when starting application on phone.http://http//prntscr.com/if0a49


#5
Hello all,
 
I think I had a similar issue:
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, 'com.xxx.app/...SplashActivity'. Starting it ourselves
I was also getting the same error when trying to run the app in Appium. 
But there is a workaround in specifying the desired capability 
in Appium and in Katalon Studio 
(Project/Settings/Execution/Default/Mobile/Android):
"appWaitActivity": "*"

This setting helped me, and I was able to run my mobile app.

scr-2018-02-15_18-01-32.png


#6

Aleksandra Pavlyshina said:

Hello all,

I think I had a similar issue:
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com.xxx.app/…SplashActivity’. Starting it ourselves
I was also getting the same error when trying to run the app in Appium.
But there is a workaround in specifying the desired capability
in Appium and in Katalon Studio
(Project/Settings/Execution/Default/Mobile/Android):
“appWaitActivity”: “*”

This setting helped me, and I was able to run my mobile app.


  

Thanks for sharing this resolution . It worked for me :slight_smile:


#7

Aleksandra Pavlyshina said:

Hello all,

I think I had a similar issue:
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com.xxx.app/…SplashActivity’. Starting it ourselves
I was also getting the same error when trying to run the app in Appium.
But there is a workaround in specifying the desired capability
in Appium and in Katalon Studio
(Project/Settings/Execution/Default/Mobile/Android):
“appWaitActivity”: “*”

This setting helped me, and I was able to run my mobile app.


  

Great ! It worked for me too. It’s driving me nuts !
Where did you get this trick ?
Thank you very much for the help.


#8

Aleksandra Pavlyshina said:

Hello all,

I think I had a similar issue:
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com.xxx.app/…SplashActivity’. Starting it ourselves
I was also getting the same error when trying to run the app in Appium.
But there is a workaround in specifying the desired capability
in Appium and in Katalon Studio
(Project/Settings/Execution/Default/Mobile/Android):
“appWaitActivity”: “*”

This setting helped me, and I was able to run my mobile app.


  

Thanks for sharing, It worked for me


#9

Hello Guys!
Hello guys!
I’m still having the similar issue:
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com…/232…SplashActivity’. Starting it ourselves
Another suggestion for this issue? The setting “appWaitActivity”: “*” it’s no works for me.


#10

Hi @delvisecheverria,

A few things you could try:

  1. Make sure you’re using Appium 1.8.1
  2. In addition to setting the appWaitActivity, also set the appWaitPackage to your app’s package name, e.g. com.mycompany.myapp

If those don’t work, could you please include what you see in the Katalon console log where it lists the “Desired Capabilities”?

Hope this helps,

Chris


#11

Hi @Chris_Trevarthen
I tried what you suggest me.

  1. Make sure you’re using Appium 1.8.1
  2. In addition to setting the appWaitActivity , also set the appWaitPackage to your app’s package name, e.g. com.mycompany.myapp

its does not work to me.

My katalon console logs.

[35m[Appium][39m Welcome to Appium v1.8.1
[35m[Appium][39m Non-default server args:
[35m[Appium][39m   port: 56127
[35m[Appium][39m   loglevel: info
[35m[Appium][39m   chromeDriverPort: 56128
[35m[Appium][39m   tmpDir: C:\Users\DECHEV~1\AppData\Local\Temp\\Katalon\Appium\Temp1551286767141
[35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:56127
[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 [90m19 ms - 83[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 [90m5 ms - 83[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\\myuser\\Katalon Studio\\MobileTestProjectSample\\androidapp\\Mobileapp.apk","appWaitActivity ":"com.company.Mobileappphone","appWaitPackage":"com.company.Mobileappphone","autoGrantPermissions":true,"automationName":"uiautomator2","deviceName":"samsung SM-T810 (Android 7.0)","fullReset":false,"newCommandTimeout":1800,"noReset":true,"platform":"ANDROID","platformName":"Android","udid":"3300724550441351"},"capabilities":{"desiredCapabilities":{"app":"C:\\Users\\myuser\\Katalon Studio\\MobileTestProjectSample\\androidapp\\Mobileapp.apk","appWaitActivity ":"com.company.Mobileappphone","appWaitPackage":"com.company.Mobileappphone","autoGrantPermissions":true,"automationName":"uiautomator2","deviceName":"samsung SM-T810 (Android 7.0)","fullReset":false,"newCommandTimeout":1800,"noReset":true,"platform":"ANDROID","platformName":"Android","udid":"3300724550441351"},"firstMatch":[{"platformName":"android"}]}}[39m
[35m[Appium][39m Could not parse W3C capabilities: 'deviceName' can't be blank. Falling back to JSONWP protocol.
[35m[Appium][39m The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["app","appWaitActivity ","appWaitPackage","autoGrantPermissions","automationName","deviceName","fullReset","newCommandTimeout","noReset","platform","platformName","udid"]. Falling back to JSONWP protocol.
[35m[Appium][39m Creating new AndroidUiautomator2Driver (v1.12.0) session
[35m[Appium][39m Capabilities:
[35m[Appium][39m   app: C:\Users\myuser\Katalon Studio\MobileTestProjectSample\androidapp\Mobileapp.apk
[35m[Appium][39m   appWaitActivity : com.company.Mobileappphone
[35m[Appium][39m   appWaitPackage: com.company.Mobileappphone
[35m[Appium][39m   autoGrantPermissions: true
[35m[Appium][39m   automationName: uiautomator2
[35m[Appium][39m   deviceName: samsung SM-T810 (Android 7.0)
[35m[Appium][39m   fullReset: false
[35m[Appium][39m   newCommandTimeout: 1800
[35m[Appium][39m   noReset: true
[35m[Appium][39m   platform: ANDROID
[35m[Appium][39m   platformName: Android
[35m[Appium][39m   udid: 3300724550441351
[35m[BaseDriver][39m The following capabilities were provided, but are not recognized by appium: appWaitActivity , platform.
[35m[BaseDriver][39m Session created with session id: 3b4e3224-36dc-4978-a3f8-62811ea3fa78
[35m[BaseDriver][39m Using local app 'C:\Users\myuser\Katalon Studio\MobileTestProjectSample\androidapp\Mobileapp.apk'
[35m[AndroidDriver][39m Java version is: 1.8.0_181
[35m[ADB][39m Checking whether adb is present
[35m[ADB][39m Found 1 'build-tools' folders under 'C:\Users\myuser\.katalon\tools\android_sdk' (newest first):
[35m[ADB][39m     C:/Users/myuser/.katalon/tools/android_sdk/build-tools/28.0.2
[35m[ADB][39m Using adb.exe from C:\Users\myuser\.katalon\tools\android_sdk\platform-tools\adb.exe
[35m[AndroidDriver][39m Retrieving device list
[35m[AndroidDriver][39m Using device: 3300724550441351
[35m[ADB][39m Using the alternative activity name detection method because of: Could not find apkanalyzer.bat in C:\Users\myuser\.katalon\tools\android_sdk\platform-tools\apkanalyzer.bat,C:\Users\myuser\.katalon\tools\android_sdk\emulator\apkanalyzer.bat,C:\Users\myuser\.katalon\tools\android_sdk\tools\apkanalyzer.bat,C:\Users\myuser\.katalon\tools\android_sdk\tools\bin\apkanalyzer.bat,C:\Users\myuser\.katalon\tools\android_sdk\build-tools\28.0.2\apkanalyzer.bat. Do you have the Android SDK installed at 'C:\Users\myuser\.katalon\tools\android_sdk'?
[35m[ADB][39m Checking whether aapt is present
[35m[ADB][39m Using aapt.exe from C:\Users\myuser\.katalon\tools\android_sdk\build-tools\28.0.2\aapt.exe
[35m[ADB][39m Extracting package and launch activity from manifest
[35m[ADB][39m Package name: 'com.company.Mobileappphone'
[35m[ADB][39m Main activity name: 'md5146f6bdb715599e366c9b557dc48e893.SplashActivity'
[35m[ADB][39m Getting device platform version
[35m[ADB][39m Using apksigner.bat from C:\Users\myuser\.katalon\tools\android_sdk\build-tools\28.0.2\apksigner.bat
[35m[ADB][39m Checking whether zipalign is present
[35m[ADB][39m Using zipalign.exe from C:\Users\myuser\.katalon\tools\android_sdk\build-tools\28.0.2\zipalign.exe
[35m[ADB][39m io.appium.uiautomator2.server was successfully uninstalled
[35m[ADB][39m io.appium.uiautomator2.server.test was successfully uninstalled
[35m[AndroidDriver][39m setDeviceLanguageCountry requires language or country.
[35m[AndroidDriver][39m Got language: 'null' and country: 'null'
[35m[ADB][39m Successfully extracted 78 strings from 'C:\Users\myuser\Katalon Studio\MobileTestProjectSample\androidapp\Mobileapp.apk' resources for '(default)' configuration
[35m[UiAutomator2][39m Starting uiautomator2 server 1.12.0
[35m[UiAutomator2][39m Using UIAutomator2 server from 'C:\Users\myuser\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v1.12.0.apk' and test from 'C:\Users\myuser\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk'
[35m[UiAutomator2][39m Running command: 'adb -s 3300724550441351 shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner'
[35m[UiAutomator2][39m Waiting up to 20000ms for UiAutomator2 to be online...
[35m[AndroidDriver][39m Screen already unlocked, doing nothing
[35m[UiAutomator2][39m UiAutomator2 did not start the activity we were waiting for, 'com.company.Mobileappphone/md5146f6bdb715599e366c9b557dc48e893.SplashActivity'. Starting it ourselves

#12

Hi @delvisecheverria,

Sorry, I should have been more clear about the settings (they should have different values):

appWaitPackage: com.company.Mobileappphone
appWaitActivity: *

Hope this helps,

Chris


#13

Hi, ive just currently downloaded the latest version of Katalon Studios on the download section of the site, after abit of tinkering around with it ive also encountered the same error as presented, I wanted to try the fixes suggested around but Ive come across a problem, I cant find a dropdown to the Execution option


#14

Hi @troy_1129,

The settings you want are actually on the Desired Capabilities->Mobile->Android screen:

Hope this helps,

Chris


#15

Hi @Chris_Trevarthen it works for me, must have 2 list desired that you mention above, thankyouuu :slight_smile: