I really need help with solving this problem updated blocks pic

I am creating a picture pair matching game, with 16 cards/buttons. When you play the game, the message:

Property getter was expecting a com.google.appinventor.components.runtime.Buttoncomponent but got a YailList instead.

Keeps coming up, what does it mean, please I really need help finding out why the message keeps popping up. The game works great apart from that meassage.

I have added my blocks

Any advice on how to solve this would be grateful

hi


see your button 13
u need to double click to complete the command
thanks

Hello NannyBB

It's very difficult to read your Blocks images because of the way they are captured. Could you replace them with App Inventor's own capture function? Right Click in the Blocks work area, and select "download blocks as image".

We could also optimise your code a bit - you repeat the same code many times to size the buttons? Take a look at the "Any Component" functions for that to reduce your code considerably.

Not sure if Neelam is correct about Button 13 being the cause of the fault - it's block is "collapsed" for viewing but that should not adversely effect code execution.

hi again @ChrisWard
i am not saying that i am correct or this is the cause of the problem she is facing as i am myself a starter but the above given was a bit of advice to her
i think making correction in this should also be done (Small steps lead to big differences)
just keeping my opinion*****
thanks

1 Like

NannyBB

Have you optimised the images for Android? Oversized (dimensions and bytes) images cause lots of issues. Usually they make the APK install fail but if they get past that they can reduce the available memory for the functions of the App, so it is important to get them just right.
See my site: https://www.professorcad.co.uk/appinventortips#TipsImages


Please export your project and post it here.

(upload://zpUcYRzpxO26bn58nvxD1qb1JJ7.jpeg)

(upload://1chlxyd953J3GGB3foZzyrbs6cP.jpeg)

Tried the in app downloading my blocks as a images and it didn't work. So I took pictures of my computer screen of the block. I hope this helps.

Start with the last one, then scroll up please.

hello NannyBB
it will be more easier to understand your code if you go in blocks , right click , select download blocks as image & send
thanks

I did the right click, and the block image came up really tiny.

I have done as you requested.

so u can send it
we can zoom & see

I did that and if you tap on the image, it will allow you to zoom in and see the blocks, please zoom in and tell me what you think, thanks.

so send it please :upside_down_face:

well @NannyBB u have many blocks collapsed see in your compare procedure
get global buttons

Hi Neelam, I have checked with others and they say having blocks collapsed does not impact on the functionality of the code, it is more for space. I have changed the collapsed blocks back to their normal look and the message is still popping up. so it is safe to say the collapsed blocks are not causing the message to pop up. Can you see anything regarding the 'getter' and how to prevent a YailList effect.

can someone tell me what the message means, please.

Hi NannyBB

It looks like it's a really fun game, I'm sure my granddaughter would like it.

Concerning the collapsed blocks, it is true that they do not affect the execution of the App, but they do affect our understanding of your code because we can't see what they are/what they do. That said, we can see most of the code you have posted :grin:

  1. I notice that your code is calling List Indexes, but the List Index numbers do not match the numbers of the buttons. In most scenarios, that matters, if only to understand what is going on.

  2. Clock Timer 1 - in order to call the Procedure "compare", the timer must be enabled. So I think you want to disable it, not enable it, within it's own block - if that is so, it should be disabled before the Procedure call. This I think may be the bug.

  3. The Procedure "inicio" is making a List of Buttons. Don't do that, simply make the List independent. How about renaming the Buttons at the same time so they are in numerical order and thus List Index = Button Number?

  4. Same with the Images List - Make it an independent List. Those images should be optimised. I would convert them to PNG because PNG scales better than JPG.

  5. For Each Number - never hard-code the 'to' -make that the length of the List it is processing.

  6. Each button Click event Block is performing a compare to see if a List is empty. I am surprised it works but clearly it is as your App is working. We would normally check the List Length.

  7. Again the button Click Events all check to see if two Lists are not empty. This check should be passed to a single Procedure instead of being repeated in each Click event.

Logic
I probably have not had enough tea today because I can't follow the logic of the App, so I can't be certain I have covered all the little things that can add up to the problem that you see. Still, you have corrections and improvements to make as I have listed.

Let me know how you get on.

... another little thing. Each button event disables the button clicked, and also all the other buttons in the buttons list. So in fact that loop should be the first item in the Event, all buttons being disabled. Currently, the clicked button is disabled twice.

ah, the images -they are may well be part of the issue because the App instances some of them more than once? So definitely optimisation is important - you could reduce the image name lengths somewhat too.

@ Neelam

You are good at spotting things that are odd, that's a valuable skill in coding.