Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Bindings for UIAccessibilityTraits. #735

Open
1 task
sinceredevotion opened this issue Jul 6, 2023 · 2 comments
Open
1 task

Missing Bindings for UIAccessibilityTraits. #735

sinceredevotion opened this issue Jul 6, 2023 · 2 comments

Comments

@sinceredevotion
Copy link

sinceredevotion commented Jul 6, 2023

Issue details

When setting traits of a UIAccessibilityElement, this is the error that I get:

Error: class java.lang.UnsatisfiedLinkError, Optional @globalvalue method org/robovm/apple/uikit/UIAccessibilityTraits.NoneValue()J not bound

Reproduction steps/code

Here is a snippet of code:

UIAccessibilityElement accessibilityElement = new UIAccessibilityElement(iosAccessibility);

    accessibilityElement.setAccessibilityFrame(new CGRect(x, y, width, height));

    if (item.GetName() != null)
        accessibilityElement.setAccessibilityLabel(item.GetName());
    else
        accessibilityElement.setAccessibilityLabel("Default Name");

    if (item.GetDescription() != null)
        accessibilityElement.setAccessibilityHint(item.GetDescription());
    else
        accessibilityElement.setAccessibilityHint("Default Description");

    if (item.GetAccessibilityCode() == item.Get_Libraries_Interface_Item__NOT_ACCESSIBLE_())
        accessibilityElement.setAccessibilityElement(false);
    else
        accessibilityElement.setAccessibilityElement(true);

    UIAccessibilityTraits traits = UIAccessibilityTraits.AllowsDirectInteraction; // The line that is crashing
    accessibilityElement.setAccessibilityTraits(traits);

    // Add the accessibility element to the list
    accessibilityElements.add(accessibilityElement);

    // Inform iOS that the accessibility elements have changed
    UIAccessibilityGlobals.postNotification(UIAccessibilityNotification.LayoutChangedNotification, accessibilityElement);

Configuration

2.3.19

Build Tools:

  • Gradle plugin

Versions:

Please provide the version of RoboVM, XCode and JDK used

  • Robovm: 2.3.19
  • Xcode: 14.3.1
  • JDK: 1.8

Build Targets:
iPhone 14 Pro Max iOS 16.

Stacktrace

//Please provide the stacktrace if applicable 

Error: class java.lang.UnsatisfiedLinkError, Optional @GlobalValue method org/robovm/apple/uikit/UIAccessibilityTraits.NoneValue()J not bound
   file: IOSAccessibility.java,  class: plugins.quorum.Libraries.Interface.Accessibility.IOSAccessibility,  action: Add,  line: 154 
   file: IOSAccessibility.quorum,  class: Libraries.Interface.Accessibility.IOSAccessibility,  action: Add,  line: -1 
   file: Layer2D.quorum,  class: Libraries.Game.Layer2D,  action: Add,  line: 249 
   file: Game.quorum,  class: Libraries.Game.Game,  action: Add,  line: 615 
   file: Main.quorum,  class: ChartTest2,  action: Add,  line: -1 
   file: Main.quorum,  class: ChartTest2,  action: CreateGame,  line: 31 
...
@dkimitsa
Copy link
Contributor

dkimitsa commented Jul 6, 2023

hi, thanks for reporting
there is a bug in bindings, will be fixed during ios17 binding update (don't close this issue).
meanwhile please use folloiwing workaround. call this line somewhere before accessing UIAccessibilityTraits

ObjCRuntime.bind(UIAccessibilityTraits.class);

@dkimitsa
Copy link
Contributor

dkimitsa commented Nov 6, 2023

fixed with 83b0282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants