New release causing problems with charts when compiled (not with Companion)

My app used to work fine until five minutes ago when the last new version was released. Now the app continues to work fine with Companion, but when I compile it and install it on my phone, it doesn't work properly. The problem seems to be related with charts and is the following: when chart tries to plot the second point, the screen shuts down and the app goes back to the previous screen (very strange). I insist in this point: The code is the same and was working fine until the new version was released (like 15 minutes ago). I'm here sharing a screenshot of the code on one of the pages that has the problem, but I have another one very similar that has the same problem:
https://recursostic.info/archivos/imagenes/tutoriales/2023-08-30_00-38-23.png

The behaviour is that when the chart is plotting the second point, the screen shuts down and goes back to the 'menu' screen like if I was tapping the 'btnVolver' button.

In case you want to review the full code, here's a link to the .aia project file:

Thanks for your help. Kind regards,

Cristián

I do not believe this is a bug in the new release, there are issues in your app that is causing it to crash (both in companion and compiled)

Your clock timer setup was incorrect, and your sensors were in "race" condition. You were also not switching screens correctly, which can also cause app crashes.

I have made some changes that now means the app does not crash, but I am unsure of your intentions with regard to the graphing. Do you want it to regularly monitor the sound/light level once it goes to that respective page?

ecosdeapp_revised.aia (1.4 MB)

Hi! Thanks a lot for your time!! It is strange that you say my app crashes while the way that I close my screen is the same I have been using in every app. Despite of that, my app used to work perfect either compiled and with Companion, until the release, and never crashed. I want the app to measure light (and sound) at every second and graph those values on my chart. Using your revised .aia project code, when I set the sound sensor to "true", the app crashes when compiled (while works fine with Companion). So, bottom line: different code still the same behaviour.
Maybe the problem is related with the sound extension and the new release. I tried to disconnect the chart blocks and the app was able to measure some values, but then it crashed again.
Thanks a ton.
Kind regards,

Cristián

Got the light sensor one working, the problem seems to be with the sound meter .....

What surprises me is that the app works perfect in Companion, never crashes, but once I compile it and install it on my Android 12 phone, it crashes either using the sound meter or the light sensor...

It is crashing in companion for me, when I test with the sound extension.

I tried a different extension: http://kio4.com/appinventor/239C_extensiones_nivel_microfono.htm

but the same thing happens....

I deleted the sonometer screen (and the extension as well) and kept the luxometer one with charts. I compiled it, installed it on my phone and it crashes. No crash without using the chart. I now have no doubts that the problem is with charts.
Kind regards,

Cristián

If you are in a hurry, two alternatives are:

Draw a graph with the canvas

Try HighCharts in a webview (you can download all the js files needed)

I have run out of time now, but will do some more research tomorrow.....

Playing a sound immediately before switching screens is unusual.

Try removing those sounds.

to find out why it crashes, use logcat

Taifun

What I would like to know is why does it work properly in Companion while crashes in my phone when compiled and installed.

A logcat result probably can give us an idea
Taifun

Hopefully resolved. Instead of adding entries, I stored values to a list, then cleared the data and imported the list. Working and tested on Android 13 companion and compiled. Also used the KIO4 extension as indicated above.

Here are the light sensor blocks

ecosdeapp_revised2.aia (1.3 MB)

APK

1 Like

U R great!! It does work perfectly when compiled and installed!! The sonometer graph doesn't work for me the sonometer with Companion because of the permission of the microphone, but worked perfect when compiled. Thanks so much for your help. I will surely be sharing new code as I progress with the next steps of my project (which includes saving data on the Cloud). Kind regards,

Cristián

audio permission should be already present in companion app...

My Companion was outdated, I've updated it and now works fine. Thanks a lot!!

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