Runtime error from companion

Does anyone know how to fix this runtime error?

my ai companion is updated to the most recent version of MIT app inventor.
this is my code

Hello Ava - welcome to the community :grin:

That looks like an extension error - the expected input, a string (text), is empty.

We can't read your blocks from the photo - use App Inventor's built-in function.
Right-mouse click in the Blocks work area and select from the pop-up menu:

download blocks

thank you so much! Is it saying that the code was picked up in a different coding language? I tried to attach a better picture of my code.

try this

Taifun

Are you using an Extension? App Inventor and the extensions are written in Java.

... this is what Taifun is suggesting - you cannot initialize a variable with a random number.

Hmm. That certainly seems like it should be doable. The random number function is provided by the App Inventor runtime, which is compiled into the app and exists even before the screen is initialized.

Oh, I see. The issue is not so much the random number, but particular picking a random number from a value that is not yet initialized (length of global pictureList).

1 Like

thank you so so so much it worked!

1 Like