[MJSONWP] Encountered internal error running command: Error: Error occured while starting App. Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity at Object.wrappedLogger.errorAndThrow (C:\Users\juanvidal\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:63:13) at ADB.callee$0$0$ (C:\Users\juanvidal\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:79:9) at tryCatch (C:\Users\juanvidal\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\juanvidal\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\juanvidal\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21) at GeneratorFunctionPrototype.invoke (C:\Users\juanvidal\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37) at process._tickCallback (internal/process/next_tick.js:103:7)
With your last suggestions now it starts up the app and I was able to login in my VM.
In the logs it says [ADB] Found package: 'com.jcor.tuadmin' and fully qualified activity name : 'com.jcor.laadministracion.activities.ListUserFunctionalUnitActivity'
and because it doesn’t find the MainActivity it shuts down.
Actually the initial problem was solved because now my VM loads my apk and shows the Login Page. I manually login and so far so good, but in Appium I see the error I mentioned before [ADB] Found package: 'com.jcor.tuadmin' and fully qualified activity name : 'com.jcor.laadministracion.activities.ListUserFunctionalUnitActivity' and it stops the app in the VM.
I tried changing the config to point to that Activity instead of the MainActivity one but no luck, same error.
that didn’t help either. I think I found the error but I wanted to hear your thoughs.
With .activities.* or with .activities.MainActivity I get an error like this in Appium before it shuts down the app in the VM: [MJSONWP] Encountered internal error running command: Error: Error occured while starting App. Original error: com.jcor.tuadmin.activities.* never started
So in the original package name was com.jcor.laadministracion and then we changed it in the configuration files but not in the code itself.
If I add the appPackage capability to set the right package name it fails with the old error.
Could it be that the only fix here is to match the configuration package name with the actual code package name??
@juanmartinvidal may you just connect to android studio with phone. start client and check what full package name + activity starting? e.g. when i am starting “Contacts” on mine LG G4 i have message like:
08-15 16:00:31.141 1474-3484/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.contacts/.activities.DialtactsActivity bnds=[0,2128][288,2392]} from uid 10053 on display 0
where i have “com.android.contacts” package name, “.activities.DialtactsActivity” activity started
08-15 10:33:13.304 898-1279/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.jcor.tuadmin/com.jcor.laadministracion.activities.MainActivity} from uid 2000 on display 0
That shows exactly what I was trying to explain. The real package in the source code is com.jcor.laadministracion while in the config files is com.jcor.tuadmin
capabilities.setCapability("appWaitActivity", "com.jcor.laadministracion.activities.MainActivity");
// or
capabilities.setCapability("appWaitActivity", "com.jcor.laadministracion.activities.*");
// or maybe even
capabilities.setCapability("appWaitActivity", "*");