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.
I think you should install API 18 from android sdk if not already installed, otherwise you can try "invalidate caches and restart" (Find: File->invalidate caches and restart).