Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up Appium Espresso - Package name issue #835

Open
ayush547 opened this issue Nov 23, 2022 · 3 comments
Open

How to set up Appium Espresso - Package name issue #835

ayush547 opened this issue Nov 23, 2022 · 3 comments

Comments

@ayush547
Copy link

Hello,
I am trying to run Appium Espresso from Appium Server GUI and Appium Inspector with the following capabilities -

{
"platformName": "android",
"appium:appPackage": "com.sample.reacttestapp",
"appium:appActivity": "MainActivity",
"appium:noReset": true,
"appium:automationName": "espresso"
}

First I started Appium Server, then the inspector directly.

I am getting the following error -

[Espresso] [Instrumentation] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=31946, uid=2000 not allowed because package io.appium.espressoserver.test does not have a signature matching the target com.sample.reacttestapp
[Espresso] [Instrumentation] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=31946, uid=2000 not allowed because package io.appium.espressoserver.test does not have a signature matching the target com.sample.reacttestapp
[Espresso] INSTRUMENTATION_STATUS: id=ActivityManagerService
[Espresso] INSTRUMENTATION_STATUS_CODE: -1
[Espresso] [Instrumentation] at android.os.Parcel.createExceptionOrNull(Parcel.java:3011)
[Espresso] at android.os.Parcel.createException(Parcel.java:2995)
[Espresso] at android.os.Parcel.readException(Parcel.java:2978)
[Espresso] at android.os.Parcel.readException(Parcel.java:2920)
[Espresso] at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:5500)
[Espresso] at com.android.commands.am.Instrument.run(Instrument.java:532)
[Espresso] at com.android.commands.am.Am.runInstrument(Am.java:208)
[Espresso] at com.android.commands.am.Am.onRun(Am.java:85)
[Espresso] at com.android.internal.os.BaseCommand.run(BaseCommand.java:62)
[Espresso] at com.android.commands.am.Am.main(Am.java:54)
[Espresso] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[Espresso] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
[Espresso] Caused by: android.os.RemoteException: Remote stack trace:
[Espresso] at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:14602)
[Espresso] at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2611)
[Espresso] at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2638)
[Espresso] at android.os.Binder.execTransactInternal(Binder.java:1280)
[Espresso] at android.os.Binder.execTransact(Binder.java:1244)
[Espresso] Instrumentation process exited with code 1 from signal null

Am I missing something? UIAutomator2 works without anything additional.
I did try building the APK and providing it under "appium:app". (Currently I have metro running and app running off of that)
I also tried to set it to sign with the same debug.keystore but I don't see how that might affect package name.

I checked docs provided in the repo, past issues and discuss.appium.io, none of the solutions were helpful. Is there some other setup work required?

@KazuCocoa
Copy link
Member

You can give app capability to handle it automatically https://github.com/appium/appium-espresso-driver#app

@ayush547
Copy link
Author

That did not work for me, had some other issues (logcat mentions - java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so, not sure what is wrong, will need to look into that). Meanwhile is there any other way around this?
Shouldn't appPackage ideally be used for this?

@KazuCocoa
Copy link
Member

You need to configure dependencies properly for your test app as Espresso framework. UI2 and Espresso are different framework by Google, so they behave differently.
https://github.com/appium/appium-espresso-driver#espresso-build-config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants