appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Gradle to build instead of Maven

Jonahss opened this issue · comments

commented

suggested by @bootstraponline to align with other Android and Appium projects. Maven is unsupported by Google.

Important: Support for the Android Developer Tools (ADT) in Eclipse is ending, per our announcement. You should migrate your app development projects to Android Studio as soon as possible. For more information on transitioning to Android Studio, see Migrating to Android Studio.

https://developer.android.com/tools/help/adt.html

commented

I use intellij. That all right?

Android Studio is built on Intellij so Intellij has excellent gradle support.

commented

👍

I am using intellij, I can look into this one

Was trying to get my fork running with Gradle and having a hard time compiling this List

I get the below error
javaclient\java-client\src\main\java\io\appium\java_client\AppiumDriver.java:84: error: findElements(By) in AppiumDriver cannot implement findElements(By) in WebDriver
public List findElements(By by){
^
return type List is not compatible with List
where RequiredElementType is a type-variable:
RequiredElementType extends WebElement declared in class AppiumDriver

I tried typecasting return value to List with no luck

javaclient\java-client\src\main\java\io\appium\java_client\AppiumDriver.java:84: error: findElements(By) in AppiumDriver cannot implement findElements(By) in WebDriver
public List< RequiredElementType > findElements(By by){
^
return type List< RequiredElementType > is not compatible with List< WebElement >
where RequiredElementType is a type-variable:
RequiredElementType extends WebElement declared in class AppiumDriver

@Jonahss @TikhomirovSergey , Gradle uses javac and it seems it is pretty stringent than eclipse or intellij compilers when it comes to Generics. I am not sure if there can be a workaround to overcome this w/o making code changes around handling generics

Per error even if RequiredElementType extends WebElement, it doesn't translate into List < RequiredElementType > extends List < WebElement >
and hence the declaration of overridden method is invalid as per the compiler

@aniket-21 Sorry for my late responce Too busy.
The fix is here:
SeleniumHQ/selenium#863
We need the Selenium version with these changes. Also I'll try to find a way to avoid this problem with Gradle too.

Thanks @TikhomirovSergey , It would be good to have the implementation changes at Selenium end rather than forcing the compilers to accept current one with warnings :)

Was implemented at #442 #465. @aniket-21 Please wait for v5.0.0