IllegalArgumentException. Can`t sent AndroidElement to com.sun.proxy.$Proxy13 error

Hello. Here is my code and additional info:

MaxOS: 10.11.3
Appium: 1.4.13
io.appium.java-client: 3.4.0
cucumber: 1.2.4

===== BaseScreen.java =====

public class BaseScreen {
protected AndroidDriver driver;

public BaseScreen(AndroidDriver driver) {
    this.driver = driver;

}

===== StartScreen.java =====

public class StartScreen extends BaseScreen {
public StartScreen(AndroidDriver driver) {
super(driver);
PageFactory.initElements(driver, this);
}

@FindBy(xpath = “//android.widget.Button”)
private AndroidElement skipButton;

public void skipUserGuide() {
skipButton.click();
}
}

===== AndroidCommonActions.java =====

public class AndroidCommonActions {
public AndroidDriver driver;

public AndroidCommonActions() {
driver = (new AndroidTestBase()).getDriver();
}
}

And I`m using Cucumber and running following test:
===== LoginSteps.java =====

public class LoginSteps extends AndroidCommonActions {
LoginScreen loginScr;

@Given(“^I tap ‘Skip’ if tutorial is displayed$”)
public void i_tap_skip_button() {
StartScreen start = new StartScreen(driver);
start.skipUserGuide();
}

And when I run the test, it launches the app but fails with the following exception:

java.lang.IllegalArgumentException: Can not set io.appium.java_client.android.AndroidElement field com.myproject.monitor.mobile.android.screens.StartScreen.skipButton to com.sun.proxy.$Proxy13

_ at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)_
_ at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)_
_ at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)_
_ at java.lang.reflect.Field.set(Field.java:758)_
_ at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:117)_
_ at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:105)_
_ at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:92)_
_ at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:79)_
_ at com.myproject.monitor.mobile.android.screens.StartScreen.(StartScreen.java:14)_
_ at com.myproject.monitor.mobile.android.steps.LoginSteps.i_tap_skip_button(LoginSteps.java:20)_
_ at ✽.Given I tap ‘Skip’ if tutorial is displayed(mobile/login.feature:5)_

But everything works well if I use “WebElement” instead of "AndroidElement"in StartScreen or other Page Object classes.
I tried to use @AndroidFindBys but it also fails. With another error, but fails.

Can somebody explain me why I can`t use AndroidElement or what should I do to avoid that exception?
Thanks in advance.

private AndroidElement skipButton;

in place of AndriodElement u can use web Element

ex:@FindBy(id=“id/etPhone”)
WebElement Phone;

Hi Oliver, any update on this? I’m facing the exact problem and it doesn’t make any sense. I’m using Appium version 7.3.0.