Getting Incorrect Package and Activity error on Appium for a Native app (Project specific)

I am getting Incorrect Package and Activity error on appium and app in getting closed .Below are my queries-

What is package and activity ? and do we need to define these as capabilities always ?.HOw can we get rid of it.

NOTE-I have defined package and activity but still its not working.

Appium logs-

ADB] Getting focused package and activity

[ADB] Running ‘C:\Users\Ankit\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window windows’

[ADB] Found package: ‘com.mcdonalds.app.uk’ and fully qualified activity name : ‘com.mcdonalds.home.activity.HomeActivity’

[ADB] Incorrect package and activity. Retrying.

[ADB] Getting focused package and activity

[ADB] Running ‘C:\Users\Ankit\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window windows’

[ADB] Found package: ‘com.mcdonalds.app.uk’ and fully qualified activity name : ‘com.mcdonalds.home.activity.HomeActivity’

[ADB] Incorrect package and activity. Retrying.

[ADB] Getting focused package and activity

[ADB] Running ‘C:\Users\Ankit\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window windows’

[ADB] Found package: ‘com.mcdonalds.app.uk’ and fully qualified activity name : ‘com.mcdonalds.home.activity.HomeActivity’

[ADB] Incorrect package and activity. Retrying.

[AndroidDriver] Shutting down Android driver

[ADB] Running ‘C:\Users\Ankit\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.mcdonalds.app.uk

[ADB] Pressing the HOME button

[ADB] Running ‘C:\Users\Ankit\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell input keyevent 3’

[AndroidBootstrap] Sending command to android: {“cmd”:“shutdown”}

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“shutdown”}

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}

[AndroidBootstrap] Received command result from bootstrap

[UiAutomator] Shutting down UiAutomator

[UiAutomator] Moving to state ‘stopping’

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap

[UiAutomator] UiAutomator shut down normally

[UiAutomator] Moving to state ‘stopped’

[ADB] Attempting to kill all uiautomator processes

[ADB] Getting all processes with uiautomator

[ADB] Running ‘C:\Users\Ankit\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ps’

[ADB] No uiautomator process found to kill, continuing…

[UiAutomator] Moving to state ‘stopped’

[Logcat] Stopping logcat capture

[ADB] Running ‘C:\Users\Ankit\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.unlock’

[AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.

[BaseDriver] Event ‘newSessionStarted’ logged at 1539455077061 (23:54:37 GMT+0530 (India Standard Time))

[W3C] Encountered internal error running command: Error: Cannot start the ‘com.mcdonalds.app.uk’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: ‘com.mcdonalds.mcdcoreapp.common.activity.SplashActivity’ or ‘com.mcdonalds.app.uk.com.mcdonalds.mcdcoreapp.common.activity.SplashActivity’ never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting

[W3C] at ADB.callee$0$0$ (C:\Users\Ankit\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:134:11)

[W3C] at tryCatch (C:\Users\Ankit\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)

[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Ankit\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)

[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\Ankit\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)

[W3C] at GeneratorFunctionPrototype.invoke (C:\Users\Ankit\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)

[W3C] at

[HTTP] <-- POST /wd/hub/session 500 40738 ms - 2401

[HTTP]

you should add the below caps
appPackage
appActivity

I have done that but problem is still persisting