I compile the apk, and I install it in my mobile (LG G4 with android 5.1). This error appear when load a screen with a lot for buttons and components.
You can see my beta (ai) app in google play in this link:
https://play.google.com/store/apps/details?id=appinventor.ai_jaumetortosavalles.TPVSimpleBarFree
I attach the error screen in this email.
Thanks for your answer.
Your AI app appears real neat. great work with AI !
1) 40 Screens...probably impossible with App Inventor 2. AI2 is a huge improvement over AI Classic, however some things worked in AI that do not work in AI2 for many reasons. App Inventor 2 apps become UNSTABLE with more than 10 screens (sometimes a developer can get away with a few more screens). You are going to have to live with the screen limitation constraints by using Horizontal and Vertical layouts as virtual screens and showing and hiding use the Visible property true/false. We don't know how you use components in your app but guess you could use some components on a single screen to probably give you the flexibility you have on 40.
2) App Inventor apps have issues when many layouts and objects are on a single screen. You said "error appear when load a screen with a lot for buttons and components" --possibly your Pedito screen? The assumption is that screen in particular needs to be redone in a style compatible with the limitations of App Inventor 2. I imagine you get the error because that page is using a lot of resources (but I do not know).
3) That the runtime error is when running the app on a device seems to indicate your app is using lots of resources. Are you using a Fixed screen or a Responsive Screen in AI2?
Some of the issue might be the size of images you store in Media versus the actual displayed images in your app. App Inventor apps currently have issues resizing large images in Media to small images in the app. MIT is aware of this and are working on a solution. The problem seems to be most intense in Android 5+ devices. The solution for many users is to re-size the Media images using an outside image manipulation tool. You might try that on the page that goes bad with many buttons with images.
4) Another issue may be how you are changing screens safely. There was no big issue using AI, however in AI2 developers have to use one of two methods...you seem to require the TribbleHunter method. http://puravidaapps.com/tribblehunter.php What might be giving you problems is how you change screens. If you do not close a screen you leave safely, freeing system memory, eventually the app will run out of system memory. This is a huge possibility in your case.
Advice is free. Take a minute to review and see what might help to get your AI Classic to work in AI2.
Regards,
Steve
I'm sorry for reply your email.
The runtime error appears when the app try to load more than one image for the product buttons in the main screen. As you see, my app is a POS, and the user can select an image for their products.
If the products hasn't any image, the screen is loaded correctly, but if I select more than one image, the error appear. With one image don't crash.
Do you understand me?
I've noticed that the canvas component creates a 4 times bigger image pixels defined in the canvas, for example, if the canvas is 100x100 when storing the image, the image is 400x400. So I modified the canvas to 64x64 pixels to create images of 256x256 for buttons.
Greetings and thanks.