Why is my app crashing - Stopwatch?

I'm kind of new to appinventor, so sorry if I'm a bit ignorant. I've been creating a stopwatch app (Moderator removed the link to your Project on the Designer... no one except MIT and you can access the Project there) and it keeps crashing in the companion app. I think it might be because my phone isn't that new and can't handle the clock because when I increase the clock interval the app lasts longer before crashing.

Can anyone clarify why this happens?

Welcome Ray.

Unfortunately, no one can see your app at the link you posted. Instead post an image of your Blocks here.

Links to a topic stopwatch in the community Search results for 'stop watch' - MIT App Inventor Community

Is that all your Blocks Ray? We need to see the settings for the Clock Timer.

Also, Clock Timers on Android are low priority, so calculating hours, minutes, seconds as you are now is going to become inaccurate over time (no pun intended).

Those are all my blocks, here are the clock settings though.
image

'Timer Always Fires' is for those Apps that need a timer to continue even when they are off-screen, which probably does not apply to your App. Why did you choose a 30 millisecond time interval?

Best to follow SteveJG's advice and do a search for Stop Watch (might be examples in the Gallery too) to see how to code one accurately.

I think the crash occurs because the Clock Timer Block (+ procedure) has not finished processing before it is called again.

Edit: Actually, since your timer can get into hours, 'Timer Always Fires' is appropriate.

What exactly is happening? What does crash mean? Do you get an error message?
Post the aia.

Set your timer interval to 1000
1000ms = 1 second
App should then run....

1 Like

Try this one (TimerInterval=30):
stopwatch_Anke.aia (6.9 KB)

Where do I find this block?
image

Also, the error that pops up on my phone says, "MIT AI2 Companion has stopped"

In my app (aia). And search for "TFormat" extension.

Works fine on my test devices.
What device and which Android version?

Android Linux 8.0.0

Build the APK and try ...

grafik

Which version?

Version 2.63

Also building the APK gives this error:

App Inventor is unable to compile this project.
The compiler error output was
________Preparing application icon
________Creating animation xml
________Creating style xml
________Creating provider_path xml
________Creating network_security_config xml
________Generating adaptive icon file
________Generating round adaptive icon file
________Generating adaptive icon background file
________Generating manifest file
________Attaching native libraries
________Attaching Android Archive (AAR) libraries
________Attaching component assets
________Invoking AAPT
AAPT time: 2.163 seconds
________Compiling source files
(compiling appinventor/ai_herui_ray_li/stopwatch/Screen1.yail to appinventor.ai_herui_ray_li.stopwatch.Screen1)

ERROR: appinventor/ai_herui_ray_li/stopwatch/Screen1.yail line 87: call to 'set-and-coerce-property!' has too few arguments (3; must be 4)

Kawa compile time: 3.286 seconds
.

I've downloaded the extension, how do I get the blocks in my app?

No problem to build the APK, try this:

I also tried my app (Companion & APK) on a very old Android 5 device. Works fine!

Where do I go to run the APK file that you uploaded?

Download it to your computer, copy it to your test device and install.