Error: Getting focused on the appactivity and packagename

I am trying to run the same code with Android4.3 version and everything is working smooth. but When i run the sam in Android4.4 I am getting the below error:

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.3”,“revision”:“34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78”}}}
info: <-- GET /wd/hub/status 200 0.742 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.3”,“revision”:“34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78”}}}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“deviceName”:“HTC”,“app”:"/Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk",“appActivity”:“com.varaha.contacts.activities.DialtactsActivity”,“appWaitPackage”:“com.esi_estech.ditto”,“platformVersion”:“4.4”,“appPackage”:“com.esi_estech.ditto”,“platformName”:“Android”,“appWaitActivity”:“com.varaha.contacts.activities.DialtactsActivity”}}

info: Client User-Agent string: Python-urllib/2.7
info: [debug] Using local app from desired caps: /Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk

info: [debug] Creating new appium session efb9a715-db78-4abe-a2cf-62e735d4955e

info: Starting android appium

info: [debug] Using fast reset? true

info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present

info: [debug] Using adb from /Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb

info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” devices

info: [debug] 1 device(s) connected

info: Found device HT44KWM05595
info: [debug] Setting device id to HT44KWM05595
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 wait-for-device

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “echo ‘ready’”

info: [debug] Starting logcat capture

info: [debug] Getting device API level

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “getprop ro.build.version.sdk”

info: [debug] Logcat terminated with code 1, signal null

info: [debug] Device is at API Level 19

info: Device API level is: 19

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “getprop persist.sys.language”

info: [debug] Current device language: en

info: [debug] java -jar “/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar” “stringsFromApk” “/Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk” “/tmp/com.esi_estech.ditto” en

info: [debug] No strings.xml for language ‘en’, getting default strings.xml

info: [debug] java -jar “/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar” “stringsFromApk” “/Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk” “/tmp/com.esi_estech.ditto”

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 push “/tmp/com.esi_estech.ditto/strings.json” /data/local/tmp

info: [debug] Checking whether aapt is present

info: [debug] Using aapt from /Users/ctl-user/Desktop/AndroidSDK/sdk/build-tools/android-4.4W/aapt
info: [debug] processFromManifest: “/Users/ctl-user/Desktop/AndroidSDK/sdk/build-tools/android-4.4W/aapt” dump xmltree “/Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk” AndroidManifest.xml

info: [debug] Set app process to:

info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for /Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk: java -jar “/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/verify.jar” “/Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk”

info: [debug] App already signed.

info: [debug] Zip-aligning /Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from /Users/ctl-user/Desktop/AndroidSDK/sdk/build-tools/android-4.4W/zipalign

info: [debug] zipAlignApk: “/Users/ctl-user/Desktop/AndroidSDK/sdk/build-tools/android-4.4W/zipalign” -f 4 “/Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk” “/var/folders/gd/c4rghf9d5zv8phtq6zbf99t40000gp/T/appium114115-22143-2ofy28.tmp”

info: [debug] MD5 for app is d15304235abb0653085f99d239ca94e0

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “ls /data/local/tmp/d15304235abb0653085f99d239ca94e0.apk”

info: [debug] Getting install status for com.esi_estech.ditto

info: [debug] Getting device API level
info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “getprop ro.build.version.sdk”

info: [debug] Device is at API Level 19

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “pm list packages -3 com.esi_estech.ditto”

info: [debug] App is installed

info: Installing App
info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “mkdir -p /data/local/tmp/”

info: [debug] Removing any old apks

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “ls /data/local/tmp/*.apk”

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell rm “/data/local/tmp/e59d26d954333091c26176621341793a.apk”

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 push “/Users/ctl-user/Documents/mobilty-ditto-release/mobilty-ditto-release.apk” /data/local/tmp/d15304235abb0653085f99d239ca94e0.apk

info: [debug] Uninstalling com.esi_estech.ditto

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “am force-stop com.esi_estech.ditto”

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 uninstall com.esi_estech.ditto

info: [debug] App was uninstalled

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “pm install -r /data/local/tmp/d15304235abb0653085f99d239ca94e0.apk”

info: [debug] Forwarding system:4724 to device:4724

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 forward tcp:4724 tcp:4724

info: [debug] Pushing appium bootstrap to device…

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 push “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar” /data/local/tmp/

info: [debug] Pushing settings apk to device…

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 install “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/settings_apk/settings_apk-debug.apk”

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.3”,“revision”:“34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78”}},“sessionId”:“efb9a715-db78-4abe-a2cf-62e735d4955e”}
info: <-- GET /wd/hub/status 200 1.010 ms - 155 {“status”:0,“value”:{“build”:{“version”:“1.3.3”,“revision”:“34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78”}},“sessionId”:“efb9a715-db78-4abe-a2cf-62e735d4955e”}

info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.3”,“revision”:“34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78”}},“sessionId”:“efb9a715-db78-4abe-a2cf-62e735d4955e”}
info: <-- GET /wd/hub/status 200 0.714 ms - 155 {“status”:0,“value”:{“build”:{“version”:“1.3.3”,“revision”:“34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78”}},“sessionId”:“efb9a715-db78-4abe-a2cf-62e735d4955e”}

info: [debug] Pushing unlock helper app to device…

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 install “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk”

info: Starting App

info: [debug] Attempting to kill all ‘uiautomator’ processes
info: [debug] Getting all processes with ‘uiautomator’
info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “ps ‘uiautomator’”

info: [debug] No matching processes found

info: [debug] Running bootstrap
info: [debug] spawning: /Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb -s HT44KWM05595 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1

info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724

info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json…
info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]

info: [debug] [BOOTSTRAP] [debug] Client connected

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window”

info: [debug] Screen already unlocked, continuing.

info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:"/data/local/tmp",“status”:0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: [“compressedLayoutHierarchy”,{“compressLayout”:false}]

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“compressedLayoutHierarchy”,“params”:{“compressLayout”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:false,“status”:0}
info: [debug] Getting device API level
info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “getprop ro.build.version.sdk”

info: [debug] Device is at API Level 19

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.esi_estech.ditto/com.varaha.contacts.activities.DialtactsActivity”

info: [debug] Waiting for pkg “com.esi_estech.ditto” and activity “com.varaha.contacts.activities.DialtactsActivity” to be focused

info: [debug] Getting focused package and activity
info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Getting focused package and activity

info: [debug] executing: “/Users/ctl-user/Desktop/AndroidSDK/sdk/platform-tools/adb” -s HT44KWM05595 shell “dumpsys window windows”

info: [debug] Stopping logcat capture

info: [debug] Logcat already stopped

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”}
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“OK, shutting down”,“status”:0}
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.

info: [debug] [UIAUTOMATOR STDOUT] Time: 21.409
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1

info: [debug] UiAutomator shut down normally

info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session

error: com.esi_estech.ditto/com.varaha.contacts.activities.DialtactsActivity never started. Current: com.esi_estech.ditto/.settings.ui.TermsAndConditionsScreen

error: Failed to start an Appium session, err was: Error: com.esi_estech.ditto/com.varaha.contacts.activities.DialtactsActivity never started. Current: com.esi_estech.ditto/.settings.ui.TermsAndConditionsScreen

info: [debug] Error: com.esi_estech.ditto/com.varaha.contacts.activities.DialtactsActivity never started. Current: com.esi_estech.ditto/.settings.ui.TermsAndConditionsScreen
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:1323:12)
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:1267:7)
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:172:9)
at ChildProcess.exithandler (child_process.js:646:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Socket. (child_process.js:969:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: /com.varaha.contacts.activities.DialtactsActivity never started. Current: c/.settings.ui.TermsAndConditionsScreen)”,“origValue”:“varaha.contacts.activities.DialtactsActivity never started. Current: /.settings.ui.TermsAndConditionsScreen”},“sessionId”:null}

info: <-- POST /wd/hub/session 500 62800.361 ms - 426

info: --> GET /wd/hub/status {}

Please help me i am stuck here…

@jonahss @bootstraponline Please help me out for the above error am using appium + Python