Android real device: Unable to launch/run more recent App with Appium 1.4.13 or 1.5.2 => appium errors

Hi,

I know that there was several discussions about this issue on the forum but unfortunately, none of them helped me to find a solution to my issue.

ISSUE:
I created some Android java tests with a build of an App to test that works well on real device => install, launch and run tests.
But when I change the build version on this App for a recent one, this same tests failed to run.
I have 2 kinds of Appium errors depending on the appium version I used.
More precisely, Appium failed to launch/run the App.

APPIUM ERRORS:

  • With Appium 1.4.13
    => Eclipse error:
    > A new session could not be created. (Original error: Cannot parse launchActivity from manifest.null)
    => Appium GUI error:
    > info: [debug] badging package: com.appName.android
    > info: [debug] badging act: null
    > error: Failed to start an Appium session, err was: Error: Cannot parse launchActivity from manifest.null

  • With Appium 1.5.2:
    => Eclipse error:

    An unknown server-side error occurred while processing the command. Original error: packageAndLaunchActivityFromManifest failed. Original error: Path must be a string. Received null

    => Appium launched in common line:
    > [ADB] Error: packageAndLaunchActivityFromManifest failed. Original error: Path must be a string. Received null

  • When every thing is right:
    (Appium logs)

    ADB] Extracting package and launch activity from manifest
    [debug] [ADB] badging package: com.appName.android
    [debug] [ADB] badging act: com.appName.android.activities.MainActivity

SET UP CAPABILITY:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“platformName”, “ANDROID”);
capabilities.setCapability(“deviceName”, “Samsung”);
capabilities.setCapability(“platformVersion”, “4.4.4”);
capabilities.setCapability(“app”, appPath);
capabilities.setCapability(“appPackage”, “com.myApp.android”);
I tried adding this capabilities with no success:
//capabilities.setCapability(“appWaitActivity”, “com.appName.android.activities.MainActivity”);
or
//capabilities.setCapability(“appWaitActivity”, “android.intent.category.LAUNCHER”);

I already took a look on this discussions but with no success:

  • Android: Unable to start app: badging act: null Cannot parse launchActivity from manifest.null #6481
  • Unable to test an app that doesn’t have a launchActivity #5049
  • appPackage and appActivity naming issue (org.abc.mobile/.view.SplashActivity) while initialising the driver #4394

Thanks you in advance for your help.

Finally I found the answer:

=> Need to add the appActivity capability:
> capabilities.setCapability(“appActivity”, “com.appName.android.activities.MainActivity”);

But I wonder why it worked before ?

If someone has an idea, I will be very interested :wink:

Thanks