java.lang.IllegalArgumentException: URI scheme is not "file"

I still have no clue as to why my app shuts down immediately just trying to look at the directory. My best guess is that filepicker and file do not play well together OR the AI2 file tools do not work (according the 'known bugs' and always suggested using someone else's file tools) OR a directory MUST be determined at development time, and CANNOT be chosen by the user OR android file system is the most convoluted system since the invention of a gene.

Please provide an example project as simple as possible and add a short description of what needs to be done to elicit this issue

Taifun

musicb.aia (1.9 KB)
To elicit the issue of it shutting down, just run it

java.lang.IllegalArgumentException: URI scheme is not "file"
          at java.io.File.<init>(File.java:424)

File component's issue.
Convert uri returned from FilePicker selection to path with FileTools' PathFromUri method and then pass that as path in IsDirectory method of File component.

Thanks vknow. At least now i can determine if i have a directory or not. I will muddle around a bit more before I give up on the idea altogether.

Cheers

Charley

musicb (1).aia (32.7 KB)

Is anyone able to help me understand how to actually play the media file that has been chosen in this sample aia?
I have narrowed down how to select the directory, pick out the mp3s from the said directory, but am having trouble being able to play the tune after selecting from the list viewer. I hve been through every conceivable combination of all boxes from File1 and FileTools1, but am having trouble understanding what I'm doing wrong.
I'd rather not just be referred to a text on the subject, I just need to know how concatenate the strings in order to make the usable file name for the desired song to be played.
Thanks for any help available

This works for me in companion Android 13

musicb_1_revised.aia (3.7 KB)

my directory path was /storage/emulated/0/Music/Singles/2010s

image

Regardless of chosen directory, I get this same error message

You have spaces in the filename... for the player component replace them by %20, see also the jukebox example here

Taifun

I downloaded your juke box, and will sort through and figure out some stuff about spaces, thanks.
After doing the %20 replacement, I still get the same error
image

Did you test with Companion or the APK?
If the latter, did you request READ_MEDIA_AUDIO permission (on Android 13+)?

This essentially word for word from Taifun, save the addition of the error message.
I have set, reset, unset permissions, but seems t make no difference, but will go back and re-investigate permissions.
Companion, APK, Chromebook... all running Android 11. This error shows on chromebook companion. I will compile it and run on a phone, see if it makes a difference yet...

Show the (relevant) blocks.
And see also here:

Hmm, there shouldn't be any problems there.

No, there should not, but there is. I have read all that I can find, followed numerous instructions and still cannot get it to work.
I may just go and buy a flippin' mp3 player!! :face_with_raised_eyebrow:

What happens if you use that example as it is?
Taifun

Try this one (build the APK and try):
jukebox2.aia (403.9 KB)

New blocks

1 Like

A couple of things,
image
image
(after cpturing error as a readable message and changing from 'Music" to "musica")
image

Make sure there is at least one audio file in the /Music folder.