xxxxxxxxxx
For me changing kotlin version and changing minSDK version resolved the issue
from
ext.kotlin_version = '1.3.50'
to
ext.kotlin_version = '1.6.0'
#########################
Change this:
minSdkVersion 16
into this:
minSdkVersion 23