Error when compiling an extension with @Options

@Options is an effective method for restricting parameters. How can I create my own OptionList?

For an extension, I tried to create a list of possible directions (forward, backward, etc.) with the name MoveDirections. To do this, I adapted a copy of the ScreenAnimation class.

This is the extension code:

 @SimpleFunction(description = "Move the robot.")
  public void Move(@Options(MoveDirection.class) String Direction) {
  ...
  }

When compiling, I get this error message:

java.lang.IllegalArgumentException: OptionList Class: de.ullisroboterseite.ursblerobot.MoveDirection is not available. Make sure that it is available to the compiler.

at com.google.appinventor.components.scripts.ComponentProcessor.tryAddOptionList(ComponentProcessor.java:2117)

Trying @SimpleProperty instead of @SimpleFunction gives the same error.

See the answers here

Taifun

This is the order in which it works for me.

Captura de pantalla 2026-02-26 042145

Let us know which extension development platform you are using so we can help you properly.

Thanks to Taifun. It's working fine now!