MIT App Inventor Companion app crashes a lot

Hi! I have been following the MiniGolf Tutorial, however whenever I run the game eventually the app crashes on my Iphone 7. I believe it has something to do with:

image

I am unsure how to resolve this, since it's an integrated part of the block system, and it usually crashes my app when the golf ball hits an edge (that's why I suspect this code above).

Update: I just tested that code disabled, and it still crashes when the ball hits and edge. I'm not sure what to do now.

This is my first post. I've seen similar posts, but no solutions I can relate to. I can live without this fix, but it would be preferred if I could stop it completely. Thanks in advance!

(PS: I also have an issue with setting the middle of images as the origin. For some reason the app says this error whenever I change it from 0.0 to anything else: "Runtime Error: Error from Companion: error: unrecognized method. (irritants: setMarkOrigin)")

from
https://doesappinventorrunonios.com/

Notice how those methods are greyed out?

The Ball, however, should be working:

1 Like

Notice how those methods are greyed out?

The Ball, however, should be working:

Ah yes. Thank you. It's unfortunate that it's not supported for ios yet. (I'm using ImageSprites for the images I'm referring to. So yeah, the ball works.)

Is there a way to mathematically place them so that they are in the correct spots as if they were anchored in the middle? (Even though it's in the corner)

Yes,
ImageSpriteX = CanvasWidth/2 - imageSpriteWidth/2
ImageSpriteY = CanvasHeight/2 - imageSpriteHeight/2

Like this?

The ImageSprite is called Tee. I'm trying to place it at the bottom middle where the ball spawns. It's also not a square; and yet it seems to squish based off this code... Why?

My wanted placement example: (Ball is white, Tee is gray rectangle with dark gray spots, and left/right arrows are irrelevant atm.)
image

That y value needs to be adjusted to use Canvas.Height (increasing towards bottom of Canvas) and Sprite.Height.

Thanks for that catch! I forgot about changing those values. But it still isn't placing it at the location I want it...

Your x value looks okay.

For the y value, I would try
Canvas1.Height - (1.2 * Tee.Height)

That puts the tee at the bottom of the Canvas, with 20% of the tee height above the bottom.

Now Tee's off the screen...

I also have this code:
image

Could I somehow position the Tee to the exact location (divided by half of x and half of y) as the GolfBall?

Does anyone have an answer for my original (and kind of more pressing) question?

Can you share a copy of the project? We have additional tools we can use for investigating crashes on our end.

Note you could also try using the beta version on Apple TestFlight. There are a lot of bug fixes coming in the next version but it won't be released until later this year.

How would I go about using TestFlight to test my app?

MiniGolf.aia (15.7 KB)
My project file :arrow_heading_up:
The tutorial I'm following :arrow_heading_down:
Mini Golf: Fling, TouchUp, TouchDown Gestures

So, it's been almost a day without response. Is anyone watching this post anymore?