Wrap gradle version in try-except

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>