1
votes

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.
1
i guess WhatsApp Images/IMG-20151222-WA0003.jpg creates problem - IntelliJ Amiya
"Added all the required permissions" In Android 6.0 It is requried that you ask for them at runtime, not just in the AndroidManifest any more developer.android.com/training/permissions/requesting.html an example: androidhub.intel.com/posts/blundell/You_have_permission_to.html - Blundell
@IntelliJAmiya No because It gives me error all time if path is anything,like camera,screenshot, picture, images etc... - Chirag Savsani
@Blundell I gave all permission in my android mobile >App info> manage permissions > imgur.com/D31zNo9 . Still I need manage permission at run time? - Chirag Savsani

1 Answers

1
votes

Per the documentation, MediaMetadataRetriever "provides a unified interface for retrieving frame and meta data from an input media file". I don't think it supports metadata retrieval from images.