"Error: activity and pkg is required for launching application" on trying to launch Android native settings

Hello, guys. Up till now I’ve been testing my own apk, but currently I have to launch Android native settings which has no apk. The problem seems to be that Appium continues to look for apk on my local machine, although I have provided appPackage and appActivity capabilities for Android settings. I’ve always launched appium with “app” parameter containing path to local file. Now I have no need for this, but I guess Appium still wants it. Is there a way to bypass it? Am I doing something wrong maybe?

Logs:

[MJSONWP] Encountered internal error running command: Error: Error occured while starting App. Original error: activity and pkg is required for launching application
at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13)
at ADB.callee$0$0$ (…/…/…/lib/tools/apk-utils.js:79:9)
at tryCatch (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at invoke (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at enqueueResult (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:185:17)
at Promise.F (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\core-js\library\modules$.export.js:30:36)
at AsyncIterator.enqueue (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at Object.runtime.async (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:209:12)
at ADB.callee$0$0 [as startApp] (…/…/…/lib/tools/apk-utils.js:57:15)
at AndroidDriver.callee$0$0$ (…/…/…/lib/commands/general.js:209:18)
at tryCatch (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at invoke (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at enqueueResult (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:185:17)
at Promise.F (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\core-js\library\modules$.export.js:30:36)
at AsyncIterator.enqueue (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at Object.runtime.async (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:209:12)
at AndroidDriver.callee$0$0 [as startAUT] (…/…/…/lib/commands/general.js:208:21)
at AndroidDriver.callee$0$0$ (…/…/…/lib/commands/general.js:163:14)
at tryCatch (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\aliaksandr_krutsko\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:109:7)

Update: If I don’t provide “app” parameter, I will get “The desired capabilities must include either an app, appPackage or browserName” error

Update 2: Error appears on calling launchApp() method from Appium Java-Client library. Without this method my app just would not launch even with all the necessary capabilities provided.

try activateApp to start Settings while the session is running

Thank you, Mykola! I’ll try it after upgrading my java-client to the last version and will let you know if it’s successful or not.