appium / appium/java-client

java.lang.AbstractMethodError in widget subclasses

Open
#2,043 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

Since java-client 8.6.0 calling the implementation of abstract methods in widget subclasses results in throwing exception java.lang.AbstractMethodError.

Environment

  • Java-client 8.6.0
  • Appium 2.1.3
  • Java 11

Code To Reproduce Issue [ Good To Have ]

Widgets:

public abstract class Tab extends Widget {

    protected Tab(WebElement element) {
        super(element);
    }

    public abstract boolean isSelected();
}
public class AndroidTab extends Tab {

    protected AndroidTab(WebElement element) {
        super(element);
    }

    @Override
    public boolean isSelected() {
        return getWrappedElement().isSelected();
    }
}

Screen:

@AndroidFindBy(id = "loginTab")
@OverrideWidget(androidUIAutomator = AndroidTab.class, iOSXCUITAutomation = IosTab.class)
private Tab loginTab;

public boolean isLoginTabSelected() {
    return loginTab.isSelected();
}

Exception Stacktraces

java.lang.AbstractMethodError: Receiver class autotests.component.tab.Tab$ByteBuddy$WYq3RqHe does not define or inherit an implementation of the resolved method 'abstract boolean isSelected()' of abstract class autotests.component.tab.Tab.
at autotests.screen.authorization.LoginScreen.isLoginTabSelected

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Tab and AndroidTab reproducer and trace how the Appium Java client creates widget subclasses for @OverrideWidget. Investigate the generated Tab$ByteBuddy class and the isSelected() call, then reproduce the failure with the Java 11, Appium 2.1.3, and java-client 8.6.0 environment. Done means abstract methods in widget subclasses no longer produce AbstractMethodError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.