Hello. I’m stuck for days trying to simply launch an app using Espresso driver with Appium. I’m on a Kotlin \ Gradle project, using appium 7.4.1 and server 1.19.1. I’m on Windows 10. Android SDK Tools and Emulator are up to date and java version is 8
Here’s the log:
Just a note, I’ve come across many other problems like signature which I found the solution, but now I’m stuck for real. I also checked the other issues here about this problem and that couldn’t help me either. Using UiAutomator2 works fine
I assume there is a conflict between module versions. lifecycleEventObserver has been added since version 2.0.0 of the component (https://developer.android.com/jetpack/androidx/releases/lifecycle). Perhaps your app uses an older version of the module, which overrides the one needed by Espresso server.
The androidx.lifecycle version is 2.2.0 is the .apk
You mentioned a different version conflict. Where else can I look for to find another androidx.lifecycle version and compare?
I got the dependency tree but I’m still clueless as what the problem is. I’m attaching the dependency tree report. Bear in mind, the app code is fresh, it has an empty main activity. It was created using Android Studio template. No business logic or third party code was added afterwards. All the dependencies were set by Android Studio. It’s hard to believe the problem is with the app. dependency_tree.txt (123.8 KB)
Added LifecycleEventObserver for the cases when a stream of lifecycle events is needed. It is a public API instead of a hidden GenericLifecycleObserver class.
I see that Espresso components (in particular androidx.test.core) are using version 2.0.0 of the lifecycle component while others use 2.1.0 or 2.2.0. Consider downgrading these that use the newer version. You could also try to mark this dependency as transitive=false for Espresso itself and see if that helps
Yes, for transitive dependencies you’d need to edit the Espresso’s gradle config. All sources are available locally on your machine as a part of appium module.
If I open the same issue in GitHub’s appium-espresso-driver project, will it have a different analysis approach ?
I have managed to fix my problem by adding this desired capability:
“espressoBuildConfig”: “{ “additionalAppDependencies”: [ “com.google.android.material:material:1.0.0”, “androidx.lifecycle:lifecycle-extensions:2.1.0” ] }”
}