The application stopped running

Hello. The application editor does not show errors. It used to work fine. Now it stops when opening. It doesn't work in the emulator. I don't understand anything, I don't seem to h
Recording_angle_meter_2.aia (604.2 KB)
ave changed anything.

To find out more about the runtime error use logcat

Taifun

It doesn't crash or close on me (tested companion on Android 13), but you are trying to save a file to /storage/emulated/0 which is no longer possible.

Have you updated your companion app to the latest version: 2.66 or 2.66u ?

Which Android version are you testing on?
On Android 11+ you can no longer save in the root directory of the external stoarge. You must use one of the Shared folders (/Documents or /Download) or the ASD.

I have MIT App Inventor 2 companion version 2.66.
Should the program change the write path to say /storage/emulated/0/Documents?
But how to do it? There is a Document1 in the objects, which does not allow you to edit its properties.

Android 4.4.2 is installed on my device.

Show the relevant blocks.

I found the reason for the error. It is in the Tasks extension (Extension to run in the Background and in the foreground mode even if the app is closed.
Extension Version: 3.8
Date Built: 2021-08-30). When I remove this extension, the program also runs on older phones (with Android 4.0.3).
Is it possible to debug or replace this extension?

Hello. The companion has updated. It works on the new phone. On phones with Android 4, the connection breaks when downloading. I have to check by downloading .apk

Hello. Testing on Android devices Android 4.4.2 and 4.0.3

Hello. Apparently, the save options are in the defaultScope variable. For correct recording in Android 11 and above, it must be set defaultScope to Share, and put "/" before the file name?

...


Screenshot_2

OK


The problem, however, is that the recorded file is visible in the root of the folder only when the Shared parameter is set. With the App value, the recorded file cannot be detected. In addition, is it necessary to duplicate the setting of the File Scope parameter directly in the program? After all, it can also be set through properties?

This does not work on Android 11+ because you cannot write (save) a non-media file in the root directory of the external storage on Android 11+ (but only in the Shared folders /Download or /Documents or the ASD).

See also here again: How to access non-media & media files on Android 11+