RippleDrawable
is introduced in API 21 and it is not backward compatible meaning the devices running on Android before Lollipop can not have RippleDrawable.
However there are certain library which can mimic the ripple effect quite excellently. Refer to this github project : https://github.com/ozodrukh/RippleDrawable
Also i suggest you to refer Android Developer https://developer.android.com/develop/index.html
If you don't wish to use library you can always check the device version and act accordingly.
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP){
// pre-lollipop
}else {
//after lollipop.
}
or you can define the drawable sepeartely for prelollipop and above lollipop.
drawable-v21 is for lollipop and above lollipop.
drawable is for prelollipop.
use the same name of the drawable and pu it in according to the Android version.