File exist in the asset

i need to know if a specified file is present in the asset directory like the example below. The file is present but the result is always false.
I have tried whit di prefix “\” or “//” but the result is the same.
Can anyone help me?

Try this /Makeroid/assets/your_file


1 Like

You are the only one who can upload assets into your apk.
So why do you need to check if it exists?

If you did not added any into your assets then there are none


I have lot of galleries like this:


I can upload photos, delete it etc. i i do not want count everitime how much photos i have in the asset. With file exist dinamically i can populate the list :wink:

Hi dora_paz,
in Kompanion your solution work fine but when a create apk and test fileexist i obtain FALSE :frowning:
I tried to use a if condition where with develop=true use “/Makeroid/assets/1.jpg” while when develop=false use “//1.jpg” but the result is always false.
Any suggestion?

In this post…

there is a block: ListAllAssets that gets a list of assets files when the app is installed.

1 Like

Try this


this will work only in the companion app, but not anymore after building the app

the file extension offers the method FileListFromAssets
Note: in Kodular this works only after building the app, see here why



Yes, this is also a bug with the File component. This path doesn’t work:
there is no path to access the assets so far.

I reported this also several times.
See here (point 4):

@Mika is / was working on it:


With the next release it should be possible too to check if a asset file exist.
No matter if companion or real apk.

It will work then with two // (slashes) at the start to tell the code it’s a asset file check.


tried but not all file are listed:

What is the extension of the files that are not listed?

.jpg image

That block works when the app is installed.
If you want to see the list of files in assets while you are in emulation (COMPANION), check:

Terminal.Run — commandLine: ls -al /mnt/sdcard/Makeroid/assets/


ls /mnt/sdcard/Makeroid/assets/

for now i have solved with dora-paz solution when the app run in companion
and [juananton1991] solution when the app is installed.

Thank you

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.