An inexplicable problem

34 views
Skip to first unread message

Andrés Martín

unread,
May 30, 2019, 5:06:53 AM5/30/19
to mitappinv...@googlegroups.com
I have the program working well. But suddenly I get this error.


Select list item: Attempt to get item number 0, of the list (com.google.appinventor.components.runtime.TextBox@25f53bc com.google.appinventor.components.runtime.TextBox@7abefa8 com.google.appinventor.components.runtime.TextBox@2a45e54 com.google.appinventor.components.runtime.TextBox@c130bc0 com.google.appinventor.components.runtime.TextBox@cfd23ec com.google.appinventor.components.runtime.TextBox@78e92d8 com.google.appinventor.components.runtime.TextBox@2c60484 com.google.appinventor.components.runtime.TextBox@4e0e4f0 com.google.appinventor.components.runtime.TextBox@887601c com.google.appinventor.components.runtime.TextBox@8b86208 com.google.appinventor.components.runtime.TextBox@f7596b4 com.google.appinventor.components.runtime.TextBox@32f6a20 com.google.appinventor.components.runtime.TextBox@ef1084c com.google.appinventor.components.runtime.TextBox@14c5d38 com.google.appinventor.components.runtime.TextBox@e0614e4). The minimum valid item number is 1.
Note: You will not see another error reported for 5 seconds.


And nothing has changed. Can it be a compilation problem that I can't control?

gerrikoio

unread,
May 30, 2019, 6:31:44 AM5/30/19
to MIT App Inventor Forum
I know some error messages are a little daunting to unpick. 

To help me understand these, I simply cut and paste into notepad and unravel manually. Just takes a couple of seconds.

So your error says:

That you are in the "Select list item" routine, and you...

are.. attempt...ing to get item number 0, of the list (... which has 15 items listed?) 

(TextBox@25f53bc, TextBox@7abefa8, TextBox@2a45e54, TextBox@c130bc0, TextBox@cfd23ec, TextBox@78e92d8, TextBox@2c60484, TextBox@4e0e4f0, TextBox@887601c, TextBox@8b86208, TextBox@f7596b4, TextBox@32f6a20, TextBox@ef1084c, TextBox@14c5d38, TextBox@e0614e4). 

And... (the answer to the problem)... The minimum valid item number is 1.

Andrés Martín

unread,
May 30, 2019, 9:30:43 AM5/30/19
to MIT App Inventor Forum
Thank you. I've also done that and I know what mistake it says. But the problem is that before it does not and now it does and has no explanation. You understand why I say that it is possible that it is a compiler problem. Another thing is that in addition to jumping the error at the same time the program works well. You see my surprise.

TimAI2

unread,
May 30, 2019, 10:04:18 AM5/30/19
to MIT App Inventor Forum
We need to see the blocks that set the textbox component list and the blocks that are calling the list....

Andrés Martín

unread,
May 30, 2019, 10:27:15 AM5/30/19
to MIT App Inventor Forum

blocks (2).png


TimAI2

unread,
May 30, 2019, 10:49:32 AM5/30/19
to MIT App Inventor Forum
Nothing jumps out at me...

You should replace "hasta = 15" with "hasta = lengthoflist > global glstCampo"
Check your two other lists have at least 15 items

Are you restarting your app in the companion in order to initialise the list ?

Andrés Martín

unread,
May 30, 2019, 11:11:50 AM5/30/19
to mitappinv...@googlegroups.com
Antes funcionaba con este código, y ahora salta el error. Yo digo iniciar el companion desde 0 pero no se si lo restablece de fabrica. Yo cuando entro en la aplicación siguen los datos ahi. Yo pensaba que se borrarian. 

Para resumir el codigo funcionaba bien antes y ahora salta el error. 

Yo con toda honestidad y humildad pienso que es un error de compilación, que yo no puedo controlar.

Además pulse al botón que pulse salta el error de forma aleatoria. No se ni donde buscar.

He borrado la aplicación de android mit app inventor y la he vuelto a instalar y sigue el error.

TimAI2

unread,
May 30, 2019, 11:29:30 AM5/30/19
to MIT App Inventor Forum
Is your problem in companion app or in a compiled app ? (apk)
It is unlikely to be a compilation issue, someting to do with the list blocks and the call
Try simplifying the calculation to just display of the content of the item from glstCampo
We need to narrow down the issue

Andrés Martín

unread,
May 30, 2019, 11:36:29 AM5/30/19
to MIT App Inventor Forum
Es que ocurre cuando pulso el botón limpiar los campos y este botón no lleva nada mas que poner a " " el campo. Además ocurre de forma aleatoria.

Andrés Martín

unread,
May 30, 2019, 11:41:14 AM5/30/19
to mitappinv...@googlegroups.com

blockss.png

Con esto también ocurre el error. Me temo que no es un error de desarrollo. 

Andrés Martín

unread,
May 30, 2019, 11:45:26 AM5/30/19
to MIT App Inventor Forum
Además no pierda perspectiva. El error dice que yo paso un indice 0 y si ve el bucle For es desde 1 a 15 de 1 en 1. Esto lo deja claro todo. Pienso que es un bug 

Chris Ward

unread,
May 30, 2019, 12:35:29 PM5/30/19
to MIT App Inventor Forum
Hello Andrés

It also happens randomly.

Can we see your Project File? I think it could be something apparently unrelated that triggers the issue.

Andrés Martín

unread,
May 30, 2019, 1:34:51 PM5/30/19
to MIT App Inventor Forum
Sucede aleatoriamente pero despues de un click a un botón.

Es un proyecto privado no es realmente importante sino que era para mi personalmente. Podeis verlo aunque de momento no queria ya que soy novato en este tipo de desarrollo.

Andrés Martín

unread,
May 30, 2019, 1:48:28 PM5/30/19
to MIT App Inventor Forum
Hola a todos por favor quiero pediros mil disculpas he detectado el error en cuanto he organizado u ordenado por categorías. Era un click de botón por componentes. Que lo puse demasiado genérico y no lo controlaba con la lista de botones.

Perdón, perdón.

Y muchísimas gracias por ayudarme. 

¿Borro esta entrada que creo que es inútil y no ayudo a nadie?

Chris Ward

unread,
May 30, 2019, 7:33:52 PM5/30/19
to MIT App Inventor Forum
Hi Andrés

Very good news that you found the cause of the problem, and no need to be sorry, we have all made similar mistakes - I am very good at making mistakes!

Do not delete your Topic, it will help others. It is always more difficult to find something wrong in your own code than it is in another's code. So, your topic will inspire others to not give up trying.

Andrés Martín

unread,
May 31, 2019, 4:01:50 AM5/31/19
to MIT App Inventor Forum
Gracias Joven :)

Pues aquí estaré para ayudarte en lo que necesites, Saludos
Reply all
Reply to author
Forward
0 new messages