There is too many question in StackOverflow about this question but Can't get any solution about Android 6.0.
I got this Exception only in Android 6.0,
I tested application in Moto X Play.
In all other Android my app works completely.
I got this exception while choose Image or Video from gallery.
MediaMetadataRetriever dataRetriever = new MediaMetadataRetriever();
dataRetriever.setDataSource(PATH);
Got exception at dataRetriever.setDataSource(PATH);
PATH is my image or video path like :
/storage/emulated/0/WhatsApp/Media/WhatsApp Images/IMG-20151222-WA0003.jpg
- Added All required permission.