io.appium.uiautomator2.common.exceptions.InvalidArgumentException: Invalid ‘shouldUseCompactResponses’ setting value type. Got: java.lang.String. Expected: java.lang.Boolean. (SessionNotCreated)

I am trying to execute the mobile automation script using Ui Path Studio.

A new session could not be created even I am not passing any capability with name “shouldUseCompactResponses”. Internally Ui Path studio setting this as string which will not allowed by the appium uiautomator2.

Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: Invalid ‘shouldUseCompactResponses’ setting value type. Got: java.lang.String. Expected: java.lang.Boolean. (SessionNotCreated)

System.InvalidOperationException: A new session could not be created. Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: Invalid ‘shouldUseCompactResponses’ setting value type. Got: java.lang.String. Expected: java.lang.Boolean. (SessionNotCreated)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Appium.AppiumDriver1.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Appium.AppiumDriver1..ctor(ICommandExecutor commandExecutor, ICapabilities appiumOptions)
at OpenQA.Selenium.Appium.Android.AndroidDriver1..ctor(ICommandExecutor commandExecutor, DriverOptions driverOptions) at UiPath.MobileAutomation.Runtime.Impl.UiPathAndroidDriver..ctor(ICommandExecutor commandExecutor, DriverOptions driverOptions) at UiPath.MobileAutomation.Runtime.Factories.DriverFactory.CreateUiPathAndroidDriver(UiPathDriverModel model) at UiPath.MobileAutomation.Runtime.Factories.DriverFactory.CreateUiPathDriver[T](UiPathDriverModel model) at UiPath.MobileAutomation.Runtime.Factories.AppiumSessionFactory.<>c__DisplayClass22_1.<Create>b__2() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
— End of stack trace from previous location —
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
— End of stack trace from previous location —
at UiPath.MobileAutomation.Runtime.Factories.AppiumSessionFactory.Create(ConnectionModel connectionModel, CancellationToken cancellationToken)
at UiPath.MobileAutomation.Runtime.Containers.DeviceScopeBuilder.Build(CancellationToken cancellationToken)
at UiPath.MobileAutomation.Activities.Services.ConnectionService.CreateAppiumServices(ConnectionModel connectionModel, CancellationToken cancellationToken)
at UiPath.MobileAutomation.Activities.Services.ConnectionService.Connect(ConnectionModel connectionModel, CancellationToken cancellationToken, Boolean mirroringEnabled)
at UiPath.MobileAutomation.Activities.MobileDeviceConnection.ExecuteAsync(NativeActivityContext context, CancellationToken cancellationToken)
at UiPath.Shared.Activities.AsyncTaskNativeImplementation.BookmarkResumptionCallback(NativeActivityContext context, Object value)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value)
at UiPath.Shared.Activities.ContinuableAsyncNativeActivity.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Can you please try updating the UiPath.MobileAutomation package

->Go to Manage Packages → UiPath.MobileAutomation and upgrade to the latest stable version

I am using the latest stable version: 25.10.1

Hi @Madda_Shailendra_Kumar,

Are you using a physical device or a cloud device? Also, please share your Appium version and a screenshot of your mobile device configuration.

Thanks

I am using real device.

  1. Android device Google pixel with OS 17
  2. Appium version: 2.19.0

Also, tried in Android 16 but same issue.
First of all why the Ui Path always expecting String values in capabilities? It should allow boolean also right?

Hi @Madda_Shailendra_Kumar,

Could you please check the following documentation? Based on the troubleshooting guide, one of the recommended remedies is to uninstall the following apps from the local device:

  • io.appium.uiautomator2.server
  • io.appium.uiautomator2.server.test

After uninstalling them, reconnect and try creating the session again.

Thanks

Try to uninstall from the Android device the following apps:

io.appium.uitutomator2.server
io.appium.uitutomator2.server.test

Reference: Activities - Troubleshooting scenarios

Then in the Studio project, try to not specify the shouldUseCompactResponses capability and retry.

I tried this but no use still getting the same issue.

If if I am not specifying this capability “shouldUseCompactResponses” internally it is sending in capabilities. I am wondering why it is not allowing Boolean in capabilities even they provided option to choose the data type!