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.
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
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
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.
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
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.
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.
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?
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.
For Each Number - never hard-code the 'to' -make that the length of the List it is processing.
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.
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.
... 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.