Path 'AssetsDir" does not exist


New Member
Licensed User
Longtime User
With this rather standard code (taken from web examples here)

Dim fd As FileDialog
Dim ret As Int
fd.FastScroll = True
fd.FilePath = File.DirAssets
fd.FileFilter = ".txt"
fd.ChosenName = "5-a1.txt"
ret = fd.Show("Choose a file to load:", "Okay", "Cancel", "", Null)
If ret = -3 OR fd.ChosenName = "" Then
End If
If File.Exists(File.DirAssets, fd.ChosenName) = False Then
Msgbox(fd.ChosenName & " does not exist.", "")
End If

I receive an error

java.lang.RuntimeException: Path 'AssetsDir'does not exist
at ...$FileDialog.loadFileList(
at ...$FileDialog.Show(

I have already verified that my files have been added to the files tab and that they are present in the .apk in a directory "/assets", together with the screen layout (.bal) file.

When I look at the paths in the File Object, they are set as follows:
File.DirInternal = "/data/data/com.mwettach.voktrainer/files"
File.DirDefaultExternal = "/mnt/sdcard/Android/data/com.mwettach.voktrainer/files"
File.DirAssets = "AssetsDir"
File.DirRootExternal = "/mnt/sdcard/"

The testing device is a 7 inch tablet running Android ICS. I am under the impression that the class variable File.DirAssets is not set correctly, for it does not look like a real path - or am I missing something?


New Member
Licensed User
Longtime User
Follow up - File.DirDefaultExternal works

The path indicated by File.DirInternal does also seem to exist, but I cannot upload files there (my device is not rooted).

With MyPhoneExplorer, I can see the DefaultExternal path
[/Memory Stick]/Android/data/com.mwettach.voktrainer/files

I have uploaded my files there and can see them and use them in the app.

Thanks for the reply.
Last edited:
Upvote 0


New Member
Licensed User
Longtime User
File.DirAssets works with ListFiles

Strange that I hadn't found several existing posts before stating that the file dialog does not work with assets.

One alternative that I found in those posts is
'Read available files
Dim AllFiles As List
which works as expected.

To enable the user to select one file from the list, my app then opens a custom dialog with a Spinner element. This is actually more convenient in my case (few files, just one dir) than the standard FileDialog, because now the user cannot type the file name and see or change the directory.

Just in case this helps another newbie, here is the code:
Dim myDropDown As Spinner

Dim text As String
For I = 0 To AllFiles.Size -1
    text = AllFiles.Get(I)
    If text.IndexOf(".txt") > - 1 Then
    End If      
'Let the user select a file
Dim cd As CustomDialog
cd.AddView(myDropDown, 0, 0, 300, 40)
cd.Show("DropDown Title", "OK", "Cancel", "", Null)
text = myDropDown.SelectedItem
Upvote 0