I am using android MediaMetaDataRetriever
which implements AutoCloseable
in an android application. I have the below code
try (final MediaMetadataRetriever retriever = new MediaMetadataRetriever()) {
retriever.setDataSource(videoUri.getPath());
return retriever.getFrameAtTime(10, getFrameOption());
}
minSDK > 21
but I am getting the following crash
No virtual method close()V in class Landroid/media/MediaMetadataRetriever; or its super classes (declaration of ‘android.media.MediaMetadataRetriever’ appears in /system/framework/framework.jar
how can this happen if MediaMetadataRetriever implements AutoCloseable