Appium Inspector: Details: Unable to build Espresso server - Process ended with exitcode 1

I’m almost at lost in here. Currently we’re having issues locating the elements using Appium (and Appium Inspector) in our Android app. Some content description are not showing as accessibility ID and it’s because we are already using Jetpack Compose. I currently have this as the desired capabilities but I’m not sure how to tailor this based on what I need. From what I understood, we only need to change the automationName to espresso but I keep on encountering the same error over and over again. I have Gradle installed already. I’m using MBP M1 chip. From other sources they mentioned we have to tailor appium:espressoBuildConfig based on build.gradle ? Any tips on doing that?


Failed to create session. A new session could not be created. Details: Unable to build Espresso server - Process ended with exitcode 1 (cmd: './gradlew -PappiumTargetPackage\ app\:assembleAndroidTest') Gradle error message: [STDOUT] > Task :app:processDebugMainManifest FAILED, [STDERR] , [STDERR] FAILURE: Build failed with an exception., [STDERR] , [STDERR] * What went wrong:, [STDERR] Execution failed for task ':app:processDebugMainManifest'., [STDOUT] 7 actionable tasks: 1 executed, 6 from cache, [STDERR] > Unable to make field private final java.lang.String accessible: module java.base does not "opens" to unnamed module @3e157a51, [STDERR] , [STDERR] * Try:, [STDERR] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights., [STDERR] , [STDERR] * Get more help at, [STDERR] , [STDERR] BUILD FAILED in 761ms. Check regarding advanced session startup troubleshooting.


  "platformName": "Android",
  "appium:platformVersion": "11.0",
  "appium:deviceName": "emulator-5554",
  "appium:app": "/Users/faithberroya/Downloads/app-global-rc.apk",
  "appium:automationName": "espresso",
  "appium:appPackage": "",
  "appium:appActivity": "",
  "appium:newCommandTimeout": "0",
  "appium:skipUnlock": "true",
  "appium:fullReset": "false",
  "appium:forceEspressoRebuild": "true",
  "appium:showGradleLog": "true",
  "appium:espressoBuildConfig": "{\"additionalAndroidTestDependencies\": [\"androidx.lifecycle:lifecycle-extensions:2.2.0\", \"androidx.activity:activity:6.6.0\",  \"androidx.fragment:fragment:1.2.0\"]}"

I tried to follow this article but I’m very new to Appium with Espresso and I only see discussion in Youtube than actual Appium with Espresso driver setup.

Machine specs:

Macbook Pro M1 Chip
Gradle 7.6
Kotlin: 1.7.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 19.0.1 (Oracle Corporation 19.0.1+10-21)
OS: Mac OS X 13.0 aarch64
Android SDK Platform Tools 33.0.3
Android SDK Tools (Obsolete) 26.1.1

same problem. any solution please?