Not able to use StartActivity function in C#

Hello!

I struggle using the StartActivity function in C#

I’m able to start the android driver with the following code :

AppiumOptions options = new AppiumOptions();
options.PlatformName = "Android";
options.AddAdditionalCapability("deviceName", name);
options.AddAdditionalCapability("platformVersion", "12.0");
options.AddAdditionalCapability("newCommandTimeout", "86400");
options.AddAdditionalCapability("noReset", "true");
options.AddAdditionalCapability("udid", serial);
options.AddAdditionalCapability("appPackage", "com.instagram.android");
options.AddAdditionalCapability("appActivity", "com.instagram.android.activity.MainTabActivity");
localDriver = new AndroidDriver<AndroidElement>(service.ServiceUrl, options, TimeSpan.FromSeconds(180));
localDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30); 

But when I try with the following code, I got an error :

AppiumOptions options = new AppiumOptions();
options.PlatformName = "Android";
options.AddAdditionalCapability("deviceName", name);
options.AddAdditionalCapability("platformVersion", "12.0");
options.AddAdditionalCapability("newCommandTimeout", "86400");
options.AddAdditionalCapability("noReset", "true");
options.AddAdditionalCapability("udid", serial);
localDriver = new AndroidDriver<AndroidElement>(service.ServiceUrl, options, TimeSpan.FromSeconds(180));
localDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);
localDriver.StartActivity("com.instagram.android", "com.instagram.android.activity.MainTabActivity"); 

The error :

An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.instagram.android' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.instagram.android.activity.MainTabActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting

Do you have any idea what the problem could be?

Thanks a lot for your help!

This is a bad url. Are you using Appium 1? Here’s the proper one for Appium 2:

@APX403, if you are using appium 2, please update your client to version 5.