alexmercerind / flutter_media_metadata

A Flutter plugin to read 🔖 metadata of 🎵 media files. Supports Windows, Linux, macOS, Android, iOS & Web.
MIT License
70 stars 40 forks source link

Error in setDataSource #16

Closed MrMontazer closed 3 years ago

MrMontazer commented 3 years ago

When I use the following code, the continuation of the code stops without any error await MetadataRetriever.fromFile(File(songInfo.filePath));

I tried to find the library problem to fix it image I noticed that an error occurs when using setFilePath (retriever.setFilePath(filePath);) image This function gives java.lang.IllegalArgumentException error without any message

alexmercerind commented 3 years ago

Could you show what argument are you actually passing? Without it I cannot tell what is wrong.

https://github.com/harmonoid/flutter_media_metadata/blob/f7773003d97d6310f6aebf2d76bd6a19a65e6955/example/android/app/src/main/AndroidManifest.xml#L11

You might wanna use legacy storage access if you are using API 29 or 29+. I'm not much Android expert.

MrMontazer commented 3 years ago

https://user-images.githubusercontent.com/48115957/131708947-ccb21eb6-e7a2-433f-a6da-240359636263.mp4

This video shows the problem. The continuation of the code stops, "worked" will not print and catch also does not run I used to use this library but now it does not work. I tried to use the previous versions but it did not work

MrMontazer commented 3 years ago

I did not try android: requestLegacyExternalStorage="true" because I am using Android 10 (API 29). But now I tried and it worked for me. Thank you very much, my problem was solved. But I don't know why I did not have this problem before