I have updated android studio with latest version and then after googling I also updated Android SDK with API 18 but still it gives the same error.
In sdk Manager download android 5.1.1, it worked for me