2

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.
Chirag Savsani
  • 6,020
  • 4
  • 38
  • 74
  • I think you can get something from here---> https://github.com/android/platform_frameworks_base/blob/master/media/java/android/media/MediaMetadataRetriever.java – Chaudhary Amar Dec 22 '15 at 11:34
  • i guess `WhatsApp Images/IMG-20151222-WA0003.jpg` creates problem – IntelliJ Amiya Dec 22 '15 at 11:35
  • *"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 http://developer.android.com/training/permissions/requesting.html an example: https://androidhub.intel.com/posts/blundell/You_have_permission_to.html – Blundell Dec 22 '15 at 11:47
  • 1
    @IntelliJAmiya No because It gives me error all time if path is anything,like camera,screenshot, picture, images etc... – Chirag Savsani Dec 22 '15 at 11:47
  • @Blundell I gave all permission in my android mobile >App info> manage permissions > http://imgur.com/D31zNo9 . Still I need manage permission at run time? – Chirag Savsani Dec 22 '15 at 12:09
  • @ChiragSavsani is this issue resolved , i facing same problem for samung g5 prime(android 8) but works fine with android 7,9,10. – Dev Mar 12 '21 at 12:46

1 Answers1

1

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.

William Seemann
  • 3,440
  • 10
  • 44
  • 78