title: Appium - PageFactory initElements is not working
body: <p>I have this Class as my page object:</p>
  
  <pre><code>public class LaunchPageObject  {
  
  private AppiumDriver&lt;AndroidElement&gt; driver;
  
  public LaunchPageObject() {
  
  }
  
  public LaunchPageObject(AppiumDriver&lt;AndroidElement&gt; driver) {
  
      this.driver=driver;
      PageFactory.initElements(new AppiumFieldDecorator(this.driver), this);
  }
  
  public void Click_SigninNow() {
  
      lnk_SigninNow.click();
  }
  
  @AndroidFindBy(xpath="//android.widget.Button[@text='LOGIN WITH FACEBOOK']")
  MobileElement btn_SignupWithEmail;
  
  @AndroidFindBy(xpath="//android.widget.Button[@text='SIGN UP WITH EMAIL']")
  MobileElement btn_LoginWithFacebook;
  
  @AndroidFindBy(xpath="//android.widget.TextView[@text='Sign in now']")
  MobileElement lnk_SigninNow;
  }
  </code></pre>
  
  <p>and I have this class as my test case class:</p>
  
  <pre><code>public class LaunchPageTest extends Android {
  
    @Test
    public void Click_SigninNow() throws MalformedURLException {
  
    LaunchPageObject lp = new LaunchPageObject(setDriver());
    lp.Click_SigninNow();
    }
  }
  </code></pre>
  
  <p>I have this error log:</p>
  
  <blockquote>
    <p>FAILED: Click_SigninNow
        java.lang.ExceptionInInitializerError
        at io.appium.java_client.pagefactory.utils.ProxyFactory.getEnhancedProxy(ProxyFactory.java:52)
        at io.appium.java_client.pagefactory.utils.ProxyFactory.getEnhancedProxy(ProxyFactory.java:33)
        at io.appium.java_client.pagefactory.AppiumFieldDecorator.proxyForAnElement(AppiumFieldDecorator.java:217)
        at io.appium.java_client.pagefactory.AppiumFieldDecorator.access$0(AppiumFieldDecorator.java:215)
        at io.appium.java_client.pagefactory.AppiumFieldDecorator$1.proxyForLocator(AppiumFieldDecorator.java:107)
        at org.openqa.selenium.support.pagefactory.DefaultFieldDecorator.decorate(DefaultFieldDecorator.java:62)
        at io.appium.java_client.pagefactory.AppiumFieldDecorator.decorate(AppiumFieldDecorator.java:155)
        at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:113)
        at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:105)
        at POM.LaunchPageObject.(LaunchPageObject.java:35)
        at TestCases.LaunchPageTest.Click_SigninNow(LaunchPageTest.java:17)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p>
  </blockquote>
  
  <p>The test opens the app but is not able to click the element. Any idea what is happening here?</p>