java.lang.ExceptionInInitializerError while initializing Page Factory

I am making POM framework with Page Factory and while initializing Page Factory with PageFactory.initElements(new AppiumFieldDecorator(driver),this) it is throwing Exception as
java.lang.ExceptionInInitializerError
at io.appium.java_client.pagefactory.utils.ProxyFactory.getEnhancedProxy(ProxyFactory.java:52)

I am using
Appium-1.6.2
Java Client-6.1.0

Changing the MobileElement to WebElement in the PageObject Class fixed this issue for me.

1 Like

Can u mention ur appium and java client version after changing to webelement for me it is not working

I am getting the same issue
do we have any solution ?
appium:java-client - 8.0.0

selenium-java - 4.0.0-beta-4

Appium server - 2.0.0-beta.40

Java - 8

Node - v18.7.0

please provide more details about the error, stack trace… maybe a bit of your code…
another question, did you update to java-client 8.0.0 recently?
did you manage to run the your tests with java-client 8.0.0 and it just stop working or it is first time since you updated?
I am asking because there are some adjustment that should be made according to java-client docs.