According to the Android developer documentation, the definition of the failed state "INCOMPATIBLE_WITH_EXISTING_SESSION" is

The request contains one or more modules that have already been requested but have not yet been installed.

I'm testing an Android app with a dynamic feature module which will be downloaded/installed after clicking a button. I want to test the scenario when the install request goes to the failed state "INCOMPATIBLE_WITH_EXISTING_SESSION". For this purpose, I click the button once and while the request is in "Downloading" state, I click the same button once again (or even couple of times more), but the request won't enter the failed state with the error code "INCOMPATIBLE_WITH_EXISTING_SESSION". As far as I understand these actions should simulate the definition above.

Do you have any explanation on why the failed state is not executed or how I can execute a scenario in which the install request enters the INCOMPATIBLE_WITH_EXISTING_SESSION state.

1

There are 1 answers

0
Harish Gyanani On

Do not download two dynamic modules in parallel or request same module more than once until installed state is received.

I have implemented a Queue so that even if multiple requests are given, it will execute it one by one. Take second request only if current module is INSTALLED or FAILED or you get callback in addOnFailureListener.