File does not exist

Hi,
with the path: / Download / BTDEVICE
the File component read the BTDEVICE file stored in the Download folder of the Tablet without any errors.

After updating android to version
Android 10
Security Patch Level: 01/05/2021
Kernel version: 4.9.205-perf +

FILE NOT EXISTING error is displayed!

I tried with various paths but always the same error ...
how can i solve?
thank you.

Try checking (:ballot_box_with_check:) the legacy mode in the properties of the File component.
screenshot-ai2-appinventor-mit-edu-1612264260904 (1)

If it doesn't work, have a look at this :arrow_down_small:
File Path Updates Starting with Android 10 (Evan's Blog)

or have a look at this topic :arrow_down_small:

I suspect you are using a file to store the name of the BT device you are connecting to? I think a better way to use TinyDb is, it's easier and faster to use than File.

1 Like

Try checking (:ballot_box_with_check:) the legacy mode in the properties of the File component.

ok work!
thanks

The correct path is this (the File component uses the relative path):

grafik

However, this only works under API > 28 if you have enabled LegacyMode as suggested by @Kaustubh_Rakhade.

However, this will no longer work if AI2 targets API 30 (Android 11) → August 2021 (for new apps).

2 Likes

However, this only works under API > 28 if you have enabled LegacyMode as suggested by @Kaustubh_Rakhade....

Is there a different solution so that the app will also work with Android 11?

Yes, see e.g. here:

1 Like