Closed afandiyusuf closed 4 years ago
@afandiyusuf what are the type of files that your are picking? Are DRM protected files from Music app?
@miguelpruivo I think not, just some random mp3 file, I send it from my mac via Itunes. I tried different mp3 filename, and the path still returning /item.mp3.
@afandiyusuf fixed with 2.0.11. 🚀
Previous to the update, it was impossible for security reasons to directly access ipod-library
files (even those non DRM protected). From now on, those files will be exported (to m4a
extension which is similar to mp3
and natively efficient by iOS) and cached into the /tmp
directory so you can use within your app. Have in mind that if you want to keep those files permanently in your app's content, you should copy/move it to your app's documents folder.
Let me know if you have any other issue related to this. If so, feel free to reopen it.
Thank you!
Great, will try it for my current project. Thank you very much @miguelpruivo
Hi @miguelpruivo First a big thanks for the wonderful job done here.
I am having the same issue (picking audio files on IOS)
It opens the music app and I can see the path of the m4a files. However I can't read them as it throws the Unhandled error FileSystemException:
I however don't know where the cached files are being stored to move it to my applications root dir or so.
Any help would be greatly appreciated thanks.
@muarachmann what is the FileSystemException being thrown?
@muarachmann what is the FileSystemException being thrown?
@miguelpruivo I get this for example -
FileSystemException: Cannot open file, path = '/private/var/mobile/Containers/Data/Application/4A493D0B-E030-4900-AD5C-456FB0BBE7EC/tmp/oceans.m4a' (OS Error: No such file or directory, errno = 2)
Probably the file is being purged somehow. Can you try accessing the file immediately after picking it?
@miguelpruivo not working, keeps giving me that error, and this fails with my audioplayer as I can't read the file. Doing a try and catch, I noticed the file never existed. Let me know if you need any other info
However, the results returned by FilePickerResult after this
FilePickerResult result =
await FilePicker.platform.pickFiles(type: FileType.audio, allowMultiple: true);
seems to be ok, I get a List
[/private/var/mobile/Containers/Data/Application/4A493D0B-E030-4900-AD5C-456FB0BBE7EC/tmp/oceans.m4a, /private/var/mobile/Containers/Data/Application/4A493D0B-E030-4900-AD5C-456FB0BBE7EC/tmp/test1.m4a, /private/var/mobile/Containers/Data/Application/4A493D0B-E030-4900-AD5C-456FB0BBE7EC/tmp/test2.m4a]
Hi @miguelpruivo more logs on Xcode, maybe this has to do with Apple,
[iTunesCloud] ACAccountStore 0x280337720 - Error retrieving iTunesStore accounts. err=Error Domain=com.apple.accounts Code=9 "(null)"
2020-12-16 13:07:10.902152+0100 Runner[534:64078] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
Any idea on this?
file_picker: ^2.0.7
Describe the bug All music files that picked with this package always returning path /item.mp3 and flutters IOSink failed to read that path.
Issue details
Error Log
Flutter Version details flutter doctor -v
Additional context This is my code