Apk crashes but ai companion works without issue

Here we go:

When we define virtual screens, we use one 'real' App Inventor Screen (most often Screen1). Screen-sized Vertical Arrangements on it are displayed/hidden as required - they are the Virtual Screens. This is generally a better approach for multi-screen Apps, they share data without having to "pass" it between screens and it also reduces code duplication, making the App more efficient and the code easier to follow if you have to return to it at a later date.

So, instead of separate "houses", virtual screens are "rooms" of the same "house".

1 Like

SteveJG's example in the tutorial is the way to go if the user is to be presented with buttons/tabs to change screens but of course the code can change screens automatically if required.

You have not mentioned Android 12 in this Topic, you wrote it as "android version in phone is 12" - so my search of the page did not find the info -oh the wonders of the internet. :upside_down_face:

Android 12/13 have the most strict security measures and they affect file handling among other things. Here is an overview by Power User Anke that you need to study:

Although you have requested write permission:

  1. Should be done from Screen1 to give the whole App permission
  2. The folders/directories you can use remain limited

My kind friend i got most of your recommendations, and i would definitely go through them. Thank you again :slight_smile:

Now, can you also suggest, if possible, what's the best way to migrate this project into a new app where i can use the existing code blocks and designers build screen 1 as home without doing everything again?

OK -

  1. back-up your Project!

Export Project

  1. Empty the Backpack (right-mouse on the icon for menu), then (right mouse in the Blocks work area for menu) 'Copy all Blocks to the Backpack'.

  2. To copy screen 'Home', in the Designer (not the Blocks), pick 'Home' in the Components palette, then use keyboard Ctrl+C to copy to the Windows Clipboard.

  3. Create a new Project with a different name, then Ctrl+V to paste.

If converting to Virtual Screens, create a Virtual Screen first (Screen sized Vertical Arrangement, height and width 'fill parent') then paste - the whole GUI should arrive below the new Vertical Arrangement, you will need to drag the components into the Vertical Arrangement.

We should be able to use Ctrl+Shift+V to avoid pasting the component related Blocks, but unfortunately that isn't working, so next step:

  1. Right mouse in the Blocks work area for menu and select 'Delete 123 Blocks' - that will delete all the Blocks and you will get a pop-up to confirm that was your intention. You will then get a pop-up moaning about there not being any Blocks - just click on 'Save the empty screen now'.

  2. Right mouse in the Blocks work area for menu and select 'Paste All Blocks from Backpack (123)'

  3. Empty the Backpack (right-mouse on the icon for menu).

  4. Save the new Project.

Note that if converting to Virtual Screens, some of the existing code is no longer required. So you might want to make a copy of the original file:

..... then butcher that copy (delete the unwanted code) and then use it for copying via Windows clipboard to the new Project, as per the instructions above.

I just noticed that you are using a Table Arrangement. That should be replaced with Horizontal Arrangements as it is a rogue component that can cause corruption.

In my case i did not needed the app storage write permission, so removing it solved my issue. Apologies for my ignorances.

1 Like

That's good to know Shariq. The Google security changes have caused a lot of confusion!

1 Like

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