Dexing error code 1 line too long

Hi trying to use Gradle I’m facing the foltowing issue while dexing the final module:

* What went wrong:
Execution failed for task ':client:test:dexApiPhoneDebug'.
> Failed to run command:
        C:\adt-bundle-windows\sdk\build-tools9.1.0\dx.bat --dex --num-threads=
Error Code:
        The command line is too long.

I’m on windows I know that maven had a similar issue that can be fixed using a trick as described in :

Does anyone have any idea how I could solve that? Thanks in advance.

Here is a possible solution for this problem: