Hi, i have an element as annotation in List of WebElement/MobileElement code below

in Java, i could access the element directly with the provided index. but in kotlin when i called the element with btnArrival0to6[1].click() it throws
Method threw 'kotlin.UninitializedPropertyAccessException' exception.
I don't think that it's the annotation that's incompatible entirely. You can use the same annotation to find a single (non-list) element just fine in Kotlin. The issue appears to come from the use of the Kotlin List instead of the Java List. Kotlin actively does not want you to use the Java List, and it complains if you do so.
However, using a typed ArrayList seems to work fine for me. Try something like:
@AndroidFindBy(accessibility = "A")
@iOSXCUITFindBy(accessibility = "B")
private lateinit var btnArrival0to6: ArrayList<MobileElement>
Issue confirmed on io.appium:java-client:7.3.0. Workaround suggested by @stupergenius is still working.
Most helpful comment
I don't think that it's the annotation that's incompatible entirely. You can use the same annotation to find a single (non-list) element just fine in Kotlin. The issue appears to come from the use of the Kotlin List instead of the Java List. Kotlin actively does not want you to use the Java List, and it complains if you do so.
However, using a typed
ArrayListseems to work fine for me. Try something like: