I was working in an app for some months and have created more than 10 versions, each one I tested with apk installed on android 7 and 9 devices.
Till August everything was running fine, in September all the builds became broken, the app force closes as soon as I press a button. The same thing now happens with all saved versions.
Unfortunately I deleted all build files, so now I don't have a working app. Interestingly all versions are running perfectly over previous Companion version, but Force Closes in the same behavior described over the last Companion version.
The routines that the button starts are just calculations an graphic plot of data received over BLE (that is constantly receiving without errors before I click the button).
If I don't find a solution I will be forced to abandon this project, and will fear spend so much time in another one.
Dear Taifun, I think the problem is not related to the BLE extension, I'm receiving, processing and displaying the data correctly (actually choosing BLE extension was my first problem in this project, I struggled to to find one that worked after build and I couldn't get the offset decimals I wanted with any of them, had to use bytes instead).
The force close happens only after starting a routine that doesn't call for BLE data.
This is an app to read Heart Rate measuring strap, the button is pressed when training begins and enables a timer that has 2 procedure calls, so I attached them also.
Guys, thanks for your help.
After generating the error logcat (that I am not able to understand):
--------- beginning of crash
09-07 19:27:22.412 7611 7691 E AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1
09-07 19:27:22.412 7611 7691 E AndroidRuntime: Process: appinventor.ai_paraoale.HIIT_1_11, PID: 7611
09-07 19:27:22.412 7611 7691 E AndroidRuntime: java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
09-07 19:27:22.412 7611 7691 E AndroidRuntime: at java.util.ArrayList.add(ArrayList.java:457)
09-07 19:27:22.412 7611 7691 E AndroidRuntime: at com.google.appinventor.components.runtime.LineChartBaseDataModel.addEntryFromTuple(LineChartBaseDataModel.java:85)
09-07 19:27:22.412 7611 7691 E AndroidRuntime: at com.google.appinventor.components.runtime.ChartData2D$1.run(ChartData2D.java:66)
09-07 19:27:22.412 7611 7691 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
09-07 19:27:22.412 7611 7691 E AndroidRuntime: at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
I supposed the error could be in one of my 3 charts (2 of them on the blocks I published), so I disabled one each time and found the problematic one.
Interestingly, after changing its data entries to another chart, it worked flawlessly again, then I deleted the problematic one and created another IDENTICAL chart and everything was ok.