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.
Open project.properties file and change the line with target=android-22 to the desired value. For example:
target=android-19