The critics I made to myself is about Screen1. The 1st release of this app is old, arund 2018 and then it was updated so many times that this new release will be very far from the original. Originally Screen1 was just the "right place" to have a full screen splash screen to show until the app initialize everything but the original had few blocks, around 300 blocks. Actually it has 1065 blocks and I woud have to add some more, probably around 50-80 blocks. So, Screen1, more or less, is always active in background. Probably make sense to change the logic so that the actual Main screen becomes Screen1 and actual Screen1 becomes Init screen. Main screen is very light, only 255 blocks, so if it becomes Screen1 at the beginning it should open the Init screen, when it finishes to initialize everything can come back to Main and in this way it should not stay in memory. This could be any way a good refactoring in terms of memory used. But I really do not know if it will solve the problem.
I can post the complete aia, if I didn't before was just to reduce the problem where it happens and because the error message. I will post the exact message in the next post to be more precise and to show it to everyone.
Screenshot of the error message for the screen PlayAudio. For the other "missing" screens just change the name of the screen, everything else is the same. Please, there is a debug notifier white message that is not related to the error, it just checks if the file to play exists. And it exists.
I look at your modification, if the problem is related to how much memory is used by screens your idea should solve the problem. Anyway seems a lot better then mine original implementation. I have to add some logic to understand when a screen is opened because a child screen closed, actually I manage the situation with the event WhenOtherScreenClosed that I do not believe it may work anymore, but to be sure I will modified your modified version and eventually use another TiniDb tag to manage it.
Many thanks.
Just opens a Play screen without close Guide. The logic is simple: in the AfterScan event stops the QR reader, eventually turn off the light and then there si a if.. else if... with a condition for each media type and a call to open another screen with value. So the Guide screen is not closed before to open one of the Play screens. When the Play screen is closed Guide screen become actives and when OtherScreenClosed is fired it restart the QR scan command.
The error shows the package name from the offline version. So after importing the offline project to online, the old package names are left somewhere. So it could be the result of your messing with the offline version...
Thanks Ramiro, do not worry, I have the problem in AI2 and AI2 Offline also. May be the same problem, I will check soon if reimport the aia solves the problem. Before I need some refactoring on Screen1 and Main in any case because Screen1 became too heavy so I would prefer to switch between Screen1 and Main screen to have less memory used (actually Screen1 is always in background so a lot of memory is used for nothing).
No, I was using AI2 with the companion, everything worked well. Then I built the apk and the problem arised. Then, as usual, I imported the aia into AI2 Offline that shown the problem too. After the suggestion of Ramiro I watched the package name in AI2 Offline and I saw that until the previous import it was com.ai2offline..test.AudioGuideLVARS079TDB and in the "broken" import it becames com.ai2offline.test.AudioGuideLVARS079TDB.Main.scm that obviously I did not change because I imported the AI2 aia leaving selected the option for "Use default package". I do not know where I may check to see the package name given by AI2 apart searching the Android folders but something went wrong in AI2 and shown also in the name of the package imported in AI2 Offline.
After some trials I found a solution very similar to Romiro suggestion that works. I had need one more step. I just report the working one but I found it after 3 different trials.
In AI2 Offline: Save as... the aia with a different name. (building the new aia still had the problem)
Export the saved as aia
Import the saved as aia selecting a new package name as com.aiotech.net.savedas
Build the aia, install the apk and verify that everything works
Import the saved as aia in AI2
In AI2 build the aia, install the apk and verify that everything works
We do not help people who use a different distribution than ai2 online. We also do not solve problems with importing projects made in other distributions and compatibility. When importing your project from offline to online, ai2 gives you an error that the project was made with a different builder. Ai2 does not guarantee that projects imported from another builder will work correctly. If you want help from us, build your projects completely online, and import them to the offline version, not the other way around. We will also require you to show an appropriate project constructed in the ai2 online version that shows the problem. Otherwise, it is a waste of time for us to look for a problem that does not exist.
If you had read with some attention my answer, you should had understand that I was working using AI2 online using the companion. Using the companion it worked. Then I built the apk using AI2 and the problem arised. After that, as usual, I imported the aia in AI2 Offline that showed the same problem too. The aia with the companion worked but not the apk built by AI2 Offline.
So, the problem is born in AI2 but the way to solve it was using AI2 Offline that solved for both. If I was not using also AI2 Offline, I had not a workable solution. Hopefully Ramiro reads also this forum also if he is the maintainer of AI2 Offline. Anyway I think "Houston we have a problem" because AI2 broken my apk package while it built it.
There is no such option, because searching our forum, I found that people using the offline version are struggling with this problem. Your image above also shows an error that includes the app package name from the offline version. So how did the name of the app package from the offline version come from the project that was made in the online version?
A lot of people are building an app with multiple screens. However, there are very few bugs you pointed out, and only from people using the offline version. Also in other threads, you provide us with example projects that gave us an error that they were not built in the online version. So I believe it's the opposite of what you're saying.
Instead of write the error in the post I made a screenshot, in that moment I was testing using AI2 Offline because it is just a little bit quick to build the apk so I posted that Apart the package name it is the same error. But you can not believe me and ignore the fact I had the problem building the apk using AI2.
I have not the mission to find bugs, sometimes happens that some goes wrong, it may be a bug or it may be something unclear, some others times an extension is not compatible with other extensions and so on. In my opinion there are things that are quite strange and not well thought as, for instance, that there is no possibility to stop the Navigator after you started it. But it is not a bug, just a difficult to understood choice. Or the problems related to the NFC reader.
I don't understand at all what the packageName in AI2 online is supposed to have to do with your problem.
Post the original AI2 online aia (and make a video showing the problem). Then - and only then - can we identify the source of the problem. Incidentally, the (correct) changing of the screens should always be tested with the APK.
AI2 does not give the possibility to change the package name of the apk, it just decides what it should be following fixed rules. But when you import the AI2 aia in AI2 Offline using the default package name it appends the last part of the package name in AI2 with its, something as changing the path of a file but not the file name. When I finish to implement a feature I build the apk in AI2, test it and then import in AI2 Offline, build the apk and test it again. When I had the problem I did not look at the package name given by AI2 Offline, after all I had the problem only with the apk built by AI2, it worked perfectly using the companion. Only after the post of Ramiro I thought to look at the package name and I saw that until the previous import was as usual, instead the apk having the problem had a different and strange package name, I mean in the Designer of AI2 Offline. So, considering it was directly imported by AI2 without any change I suspect that something went wrong building the apk using AI2. In practice reimporting the aia in AI2 Offline giving a right package name it build the apk and also importing the aia in AI2 and building the apk using AI2 works. So, may be the package name change has nothong to do with the error but at least may be an "error flag" that something went wrong. May be that the maintainers of AI2 may understand what this may mean. In any case I think that having the possibility to set the package name should be implemented also in AI2, actually package names do not look so good.