Necessary and sufficient conditions for trivial solutions in supergravity