Empty list at first application initialization

Hello!
I ran into a rather strange problem. When I launch my application for the first time, I get this error.
vq

Here is the complete application code.

And here are two blocks responsible for loading questions and voice files. As I was able to find out, the questions are fully loaded (4), but not voice files. Although if I close the application and open it later, then this error does not occur anymore. Moreover, both blocks are identical (with the exception of checking the Length, but it does not matter).


What could be the reason?

In get entry, value is not present there. Thats why it is saying, Length of list 0.

First check whether the values are getting or not by using a label.

2 Likes

Use Do it instead of a label
Btw, you have to be sure that,
The presence of text in csv.
After that, you should not use loop. It will add the same question for the loop. You can literally
Set global question to list from csv table.
And btw, if you use csv table, your result will be
(Question1) with bracket.

1 Like

Before you take the first item, check the length of the list

1 Like

Thanks for answers. I want to make some clarifications. I personally can’t understand why this error only occurs when I first start the application (after installation). When the application closes due to an error, all subsequent launches are perfect.

But at the first start after installation, the length of the list with questions is 4, but the length of the list with audio recordings is 0. Although both blocks are identical. Why, if the blocks are the same, then the results are different? In one case, the list of questions is loaded, and in the other case, the length of the list of mp3 file names is 0 (but only during the first installation of the application).

The CSV files are correct. Questions are displayed correctly, without brackets, no loops, repetitions and duplication. The problem is not in the list with questions, but in the list with the names of mp3 files.

That is, at the first start after installation, the length of the list with questions is 4, the length of the list with audio is 0. After the application is restarted, the length of the list with questions is 4, the length of the list with audio is 4. And after that I can not reproduce the error. To get this error again, I have to uninstall the application and reinstall it.

By the way, the error appears only in the assembled application. When I test the application through the Companion, there is no error.

The problem may be related to the File component. There is a bug because it incorrectly requests READ permission, even when reading from the assets. Try this extension:

1 Like

So, here are screenshots of how and when the application sees the data.

  1. During the first initialization of the application (immediately after installation). When I open the screen and allow access to files, the application sees only questions, but not the names of mp3 files.

  2. When I click on the “New Chat” button, an error appears. 4 questions. 0 mp3 files.

  3. After closing the application and reopening, we see the main menu. And … 4 questions and 4 mp3 files.

  4. When I click on the button “New chat” there is no error. 4 questions and 4 mp3 files.
    04

That is, the application does not see a list with the names of mp3 files when I first start the application after installation. But after the application crashes, this error disappears on its own.

Hello! Thank you very much for your participation in this topic. Now I will download this extension and try it.

There shouldn’t be any permission to access files from the assets.

1 Like

Do you mean the extension that you recommended? Yes, absolutely right. Everything works there. Here are the screenshots.

  1. The main menu during the first run.
  2. When I click on the button “New chat”.
    02

As for my previous screenshots, this applied to the original file blocks. Yes, it was some strange glitch that I described in some detail. As soon as I changed the original file blocks to the file blocks from the extension, the error disappeared. I hope that this topic will be useful to people who will encounter such a problem.

bodymindpower, I heartily thank you. You are my savior.

1 Like

And the app should no longer request READ_EXTERNAL_STORAGE permission.

1 Like

Yes, you are absolutely right.

1 Like

If it happen only when the first initialization, then I think of the Tiny DB.

And try this as well, no matter if it is realted or not.

1 Like

Since the error disappeared as soon as I used the extension for files, I agree with bodymindpower that this is a glitch of the standard file block.

When I make an extended version of this application, I will definitely try it as well. The more options I use, the more experience I will get. Thank you.

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