If a Dakota based optimization fails (it might also generate only one design and then stop) and if the dakota.err file contains the following message:

Could not spawn; error code 22 (Invalid argument)

The solution might be to choose File-->Settings-->Dakota and toggle the checkbox "use system instead of fork"