I have installed android studio 2.2 and created new project but gradle sync failed every time and getting following exception.
Error:Cause: java.lang.NullPoi
Thanks @keddy 1201 his comment saved my life. I have tried uninstalling studio and java sdk and then reinstalled again couple of times with previous version and with also new versions.
Tried running studio as administrator solved the problem