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

Resources$NotFoundException Resource is not a Drawable #449

Open
copolii opened this issue May 10, 2019 · 62 comments
Open

Resources$NotFoundException Resource is not a Drawable #449

copolii opened this issue May 10, 2019 · 62 comments

Comments

@copolii
Copy link

copolii commented May 10, 2019

Appium v1.12.0
I'm not very familiar with Appium, this is my first crack at this.

I get the following exception when I try to start an Appium session with espresso. The crash is happening in the onCreate method of all my activities (I've tried starting with different activities) via androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:71).
This crash does not happen when I change the driver to UiAutomator2, run the app on its own, or run my Espresso test suite. The crash only occurs when I run through Appium via the Espresso driver.

My config JSON:

{
  "deviceName": "P500",
  "platformName": "Android",
  "platformVersion": 21,
  "automationName": "Espresso",
  "app": "C:\\builds\\redacted-debug.apk",
  "appPackage": "com.redacted.debug",
  "udid": "123456789",
  "appActivity": "com.redacted.activity.SplashActivity",
  "noReset": true,
  "skipUnlock": true
}

Exception Stack trace:

04-26 22:29:07.231 31232 31232 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.redacted.debug/com.redacted.activity.SetupActivity}: android.content.res.Resources$NotFoundException: Resource "com.redacted.debug:dimen/cockpit_section_status_max_width" (7f070059)  is not a Drawable (color or path): TypedValue{t=0x5/d=0x25801 a=2 r=0x7f070059}
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.ActivityThread.access$800(ActivityThread.java:151)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.os.Handler.dispatchMessage(Handler.java:102)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.os.Looper.loop(Looper.java:135)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.ActivityThread.main(ActivityThread.java:5257)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at java.lang.reflect.Method.invoke(Native Method)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at java.lang.reflect.Method.invoke(Method.java:372)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:750)
04-26 22:29:07.231 31232 31232 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: Resource "com.redacted.debug:dimen/cockpit_section_status_max_width" (7f070059)  is not a Drawable (color or path): TypedValue{t=0x5/d=0x25801 a=2 r=0x7f070059}
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.content.res.Resources.loadDrawableForCookie(Resources.java:2441)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.content.res.Resources.loadDrawable(Resources.java:2381)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.content.res.Resources.getDrawable(Resources.java:787)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.content.Context.getDrawable(Context.java:403)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:463)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:203)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:753)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:196)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:86)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:260)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.app.AppCompatDelegate.create(AppCompatDelegate.java:182)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.app.AppCompatActivity.getDelegate(AppCompatActivity.java:520)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at com.redacted.activity.SetupActivity.onCreate(SetupActivity.java:125)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.Activity.performCreate(Activity.java:6013)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:674)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
04-26 22:29:07.231 31232 31232 E AndroidRuntime:       ... 10 more

Trying with Appium 1.13.0 gives me a different error:

[debug] [MJSONWP] Encountered internal error running command: Error: java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=13136, uid=13136 not allowed because package io.appium.espressoserver.test does not have a signature matching the target com.redacted.debug

@Ludobaka
Copy link

Have you tried rebuilding your app with Espresso ? I encountered the same problem last week while discovering Appium. Do not forget to uninstall your app from the device before starting a new Appium session, just in case.

I'm sorry I can't help more if this is a real issue.

Reference here

@copolii
Copy link
Author

copolii commented May 13, 2019

I can run my Espresso tests outside of Appium without issue. Is that what you mean by "rebuilding your app with Espresso"?

@ganjarpanji
Copy link

im facing the same issue, have you found the solution @copolii ?

@sfkir
Copy link

sfkir commented Jul 31, 2019

Also have the same issue. Is there any solution? @copolii @ganjarpanji

@ganjarpanji
Copy link

@sfkir not yet, do you have any idea with this issue @saikrishna321 @KazuCocoa ?

@ganjarpanji
Copy link

here my specific error :

[Espresso] [Instrumentation] [STDOUT] android.content.res.Resources$NotFoundException: Drawable com.appname.android.staging:dimen/dimen_name_icon_size with resource ID #0x7f070059
[debug] [Espresso] [Instrumentation] [STDOUT] Caused by: android.content.res.Resources$NotFoundException: Resource "com.appname.android.staging:dimen/dimen_name_icon_size" (7f070059) is not a Drawable (color or path): TypedValue{t=0x5/d=0x3801 a=2 r=0x7f070059}

@KazuCocoa
Copy link
Member

As #460 (comment) , I thought this kind of error was dependencies inside product code and espresso driver.
For example, using AndroidX instead of previous support libraries, enable vector drawable option etc.

I have no exact answer for it, unfortunately, since mostly it depends on dependencies in production code and espresso...

@sfkir
Copy link

sfkir commented Jul 31, 2019

But crash doesn't happen when I run Espresso tests. This only happen when I run my Appium tests with Espresso driver.

@KazuCocoa
Copy link
Member

KazuCocoa commented Jul 31, 2019

I forgot which issues or somewhere, but I saw/heard a similar situation. (Maybe similar case, but sorry if it is wrong. I could not remember clear for now...)

Vanilla espresso could build and launch while Appium espresso failed.
It was fixed tweaking product? code's package references. Vanilla espresso built with production code, so dependencies were resolved then accidentally.

@ganjarpanji
Copy link

currently my app already migrate with androidX, how about you @sfkir ? now im testing with older version app

@sfkir
Copy link

sfkir commented Jul 31, 2019

@ganjarpanji Yes, our app already migrated with AndroidX.

@KazuCocoa
Copy link
Member

AndroidX was just an example.

I googled the word and found some similar issues.
Did you coordinate your resource packages for proper resolution?

https://stackoverflow.com/questions/55862661/resourcesnotfoundexception-thrown-after-updating-gradle-plugin-to-3-4-0
https://stackoverflow.com/questions/29095063/resourcesnotfoundexception-resource-is-not-a-drawable-color-or-path

@dkonurov
Copy link

dkonurov commented Aug 7, 2019

Hi everyone, I think this problem when android try load windowBackground from theme

@dkonurov
Copy link

dkonurov commented Aug 7, 2019

when we are set windowBackground=@null into theme, this work corrected. I think error create R file or problem with styable

@ganjarpanji
Copy link

hi @dkonurov can you verify if windowBackground=@null work? if yes, so we should ask developer to update those in the app?

@TarCV
Copy link

TarCV commented Aug 28, 2019

I've managed to fix it for our app by changing this driver:

  • changed all SDK versions in both build.gradle and server manifest to match versions in AUT
  • disabled transitive dependencies for espresso-contrib (I guess these dependencies are main cause for this issue)
  • excluded androidx.test.espresso group from transitive dependencies of espresso-web

Overall I think Android build process is too complex to have espresso server setup as simple as it is now. I'd be much more confident in the server if it had most android dependencies compileOnly and its manifest were generated based on AUT manifest.

@mykola-mokhnach
Copy link
Contributor

@TarCV You are always welcome to create a PR if you have good improvement proposals

@TarCV
Copy link

TarCV commented Aug 28, 2019

I'm not sure I'll have time to implement general fix, but count me in for testing such fix.

@aldochristiaan
Copy link

I've managed to fix it for our app by changing this driver:

  • changed all SDK versions in both build.gradle and server manifest to match versions in AUT
  • disabled transitive dependencies for espresso-contrib (I guess these dependencies are main cause for this issue)
  • excluded androidx.test.espresso group from transitive dependencies of espresso-web

Overall I think Android build process is too complex to have espresso server setup as simple as it is now. I'd be much more confident in the server if it had most android dependencies compileOnly and its manifest were generated based on AUT manifest.

Oh my god, big thanks for your answer! Finally, I can run it on androidx! 💯

@ganjarpanji
Copy link

awesome, thanks guys i managed to make it work now. 😆

I'd be much more confident in the server if it had most android dependencies compileOnly and its manifest were generated based on AUT manifest.

Totally agree with this, we should make the build of it more generic somehow.

@poojachoudhary13
Copy link

poojachoudhary13 commented Sep 25, 2019

@TarCV @aldochristiaan @ganjarpanji Hi guys i am also facing the same issue with our app since it migrated to androidx. I tried the above fix but it does not seem to be working for me. Please let me if i did anything wrong. Below is the change i did in build.gradle

  • Changed sdk versions in build.gradle and AndroidManifest-test.xml files

  • androidTestImplementation("androidx.test.espresso:espresso-contrib:$espresso_version") {
    transitive = false
    }

  • androidTestImplementation ("androidx.test.espresso:espresso-web:$espresso_version") {
    exclude group: 'androidx.test.espresso'
    }

@poojachoudhary13
Copy link

poojachoudhary13 commented Sep 25, 2019

in device logs i can see this exception as well. Not sure if it has to do something with the error.

09-25 16:09:06.161 D/ScribeSDK(20471): processNewTrackEvent trackEvent=TrackEvent(trackName=cx.variable_forceupdate.success, attributes={}, time=1569407946144)
09-25 16:09:06.162 D/ScribeSDK(20471): recordNewEvent: track.cx.variable_forceupdate.success
09-25 16:09:06.180 I/zygote64(20471): Rejecting re-init on previously-failed class java.lang.Class<androidx.core.app.CoreComponentFactory>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/app/AppComponentFactory;
09-25 16:09:06.181 I/zygote64(20471):   at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
09-25 16:09:06.181 I/zygote64(20471):   at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:453)
09-25 16:09:06.181 I/zygote64(20471):   at void androidx.test.internal.runner.TestLoader.doCreateRunner(java.lang.String, boolean) (TestLoader.java:72)
09-25 16:09:06.181 I/zygote64(20471):   at java.util.List androidx.test.internal.runner.TestLoader.getRunnersFor(java.util.Collection, boolean) (TestLoader.java:104)
09-25 16:09:06.181 I/zygote64(20471):   at org.junit.runner.Request androidx.test.internal.runner.TestRequestBuilder.build() (TestRequestBuilder.java:789)
09-25 16:09:06.181 I/zygote64(20471):   at org.junit.runner.Request androidx.test.runner.AndroidJUnitRunner.buildRequest(androidx.test.internal.runner.RunnerArgs, android.os.Bundle) (AndroidJUnitRunner.java:543)
09-25 16:09:06.181 I/zygote64(20471):   at void androidx.test.runner.AndroidJUnitRunner.onStart() (AndroidJUnitRunner.java:386)
09-25 16:09:06.181 I/zygote64(20471):   at void android.app.Instrumentation$InstrumentationThread.run() (Instrumentation.java:2084)
09-25 16:09:06.181 I/zygote64(20471): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.app.AppComponentFactory" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/io.appium.espressoserver.test--wSpwHyrLOTDMlA6fz3S6Q==/base.apk", zip file "/data/app/com.gamma.passenger-Hdnm-CSSqwLY-cb9dRjDYw==/base.apk"],nativeLibraryDirectories=[/data/app/io.appium.espressoserver.test--wSpwHyrLOTDMlA6fz3S6Q==/lib/arm64, /data/app/com.gamma.passenger-Hdnm-CSSqwLY-cb9dRjDYw==/lib/arm64, /data/app/io.appium.espressoserver.test--wSpwHyrLOTDMlA6fz3S6Q==/base.apk!/lib/arm64-v8a, /data/app/com.gamma.passenger-Hdnm-CSSqwLY-cb9dRjDYw==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
09-25 16:09:06.181 I/zygote64(20471):   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
09-25 16:09:06.181 I/zygote64(20471):   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
09-25 16:09:06.181 I/zygote64(20471):   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
09-25 16:09:06.181 I/zygote64(20471):   at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
09-25 16:09:06.181 I/zygote64(20471):   at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:453)
09-25 16:09:06.181 I/zygote64(20471):   at void androidx.test.internal.runner.TestLoader.doCreateRunner(java.lang.String, boolean) (TestLoader.java:72)
09-25 16:09:06.181 I/zygote64(20471):   at java.util.List androidx.test.internal.runner.TestLoader.getRunnersFor(java.util.Collection, boolean) (TestLoader.java:104)
09-25 16:09:06.181 I/zygote64(20471):   at org.junit.runner.Request androidx.test.internal.runner.TestRequestBuilder.build() (TestRequestBuilder.java:789)
09-25 16:09:06.181 I/zygote64(20471):   at org.junit.runner.Request androidx.test.runner.AndroidJUnitRunner.buildRequest(androidx.test.internal.runner.RunnerArgs, android.os.Bundle) (AndroidJUnitRunner.java:543)
09-25 16:09:06.181 I/zygote64(20471):   at void androidx.test.runner.AndroidJUnitRunner.onStart() (AndroidJUnitRunner.java:386)
09-25 16:09:06.181 I/zygote64(20471):   at void android.app.Instrumentation$InstrumentationThread.run() (Instrumentation.java:2084)
09-25 16:09:06.181 I/zygote64(20471):
09-25 16:09:06.182 E/TestLoader(20471): Could not find class: androidx.core.app.CoreComponentFactory

@ganjarpanji
Copy link

@poojachoudhary13 i think there is already a PR to fix #497 you could check on that.

@poojachoudhary13
Copy link

@ganjarpanji i checked the PR too. Only one thing is changed in the above PR.
androidTestImplementation("androidx.test.espresso:espresso-contrib:$espresso_version") {
transitive = false
}
How did you fix it. Did you do all the 3 changes mentioned by @TarCV or just the one mentioned in #497

@aldochristiaan
Copy link

aldochristiaan commented Sep 26, 2019

@poojachoudhary13 you should replace default appium espresso server APK inside /usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/espresso-server/app/build/outputs/apk/androidTest/debug/ with newly generated APK with changes that @TarCV mentioned above ..

Don't use capability forceEspressoRebuild after you replace the APK ..

@poojachoudhary13
Copy link

@aldochristiaan Thankyou, it worked for me too. I did not notice earlier that there was a cached apk as well which i had to delete.

@poojachoudhary13
Copy link

poojachoudhary13 commented Oct 3, 2019

@aldochristiaan @TarCV - After a new app release i am getting this exception now while starting espresso server session. Not sure if this is due to the changes i did for fix the above issue.

10-01 18:12:40.662 E/AndroidRuntime(14681): Process: com.gamma.passenger, PID: 14681
10-01 18:12:40.662 E/AndroidRuntime(14681): java.lang.NoSuchMethodError: No static method lifecycleEventObserver(Ljava/lang/Object;)Landroidx/lifecycle/LifecycleEventObserver; in class Landroidx/lifecycle/Lifecycling; or its super classes (declaration of 'androidx.lifecycle.Lifecycling' appears in /data/app/io.appium.espressoserver.test-1/base.apk)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.lifecycle.LifecycleRegistry$ObserverWithState.<init>(LifecycleRegistry.java:354)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:170)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.activity.ComponentActivity.<init>(ComponentActivity.java:94)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:127)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:77)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.base.lifecycle.ExtensibleActivity.<init>(ExtensibleActivity.kt:16)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.base.rx.lifecycle.RxActivity.<init>(RxActivity.kt:24)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.utils.permissions.BasePermissionActivity.<init>(BasePermissionActivity.kt:18)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.pax.newface.presentation.newface.NewFace.<init>(NewFace.kt:122)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at java.lang.Class.newInstance(Native Method)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.Instrumentation.newActivity(Instrumentation.java:1100)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.test.runner.MonitoringInstrumentation.newActivity(MonitoringInstrumentation.java:761)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2570)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2743)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.-wrap12(ActivityThread.java)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.os.Handler.dispatchMessage(Handler.java:102)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.os.Looper.loop(Looper.java:154)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.main(ActivityThread.java:6165)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at java.lang.reflect.Method.invoke(Native Method)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)`

@aldochristiaan
Copy link

@aldochristiaan @TarCV - After a new app release i am getting this exception now while starting espresso server session. Not sure if this is due to the changes i did for fix the above issue.

10-01 18:12:40.662 E/AndroidRuntime(14681): Process: com.gamma.passenger, PID: 14681
10-01 18:12:40.662 E/AndroidRuntime(14681): java.lang.NoSuchMethodError: No static method lifecycleEventObserver(Ljava/lang/Object;)Landroidx/lifecycle/LifecycleEventObserver; in class Landroidx/lifecycle/Lifecycling; or its super classes (declaration of 'androidx.lifecycle.Lifecycling' appears in /data/app/io.appium.espressoserver.test-1/base.apk)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.lifecycle.LifecycleRegistry$ObserverWithState.<init>(LifecycleRegistry.java:354)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:170)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.activity.ComponentActivity.<init>(ComponentActivity.java:94)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:127)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:77)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.base.lifecycle.ExtensibleActivity.<init>(ExtensibleActivity.kt:16)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.base.rx.lifecycle.RxActivity.<init>(RxActivity.kt:24)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.utils.permissions.BasePermissionActivity.<init>(BasePermissionActivity.kt:18)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.gamma.pax.newface.presentation.newface.NewFace.<init>(NewFace.kt:122)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at java.lang.Class.newInstance(Native Method)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.Instrumentation.newActivity(Instrumentation.java:1100)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at androidx.test.runner.MonitoringInstrumentation.newActivity(MonitoringInstrumentation.java:761)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2570)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2743)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.-wrap12(ActivityThread.java)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.os.Handler.dispatchMessage(Handler.java:102)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.os.Looper.loop(Looper.java:154)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at android.app.ActivityThread.main(ActivityThread.java:6165)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at java.lang.reflect.Method.invoke(Native Method)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
10-01 18:12:40.662 E/AndroidRuntime(14681): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)`

Were you using release version for automation ?
I experienced this too and had a talk with our developer and in the end we found the root cause.
Try to changeproguard rules in your local machine and build the release version APK using this configuration :

-dontwarn com.google.android.material.**
-keep class com.google.android.material.** { *; }

-dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }

-dontwarn android.support.v4.**
-keep class android.support.v4.** { *; }

-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }

I'm sure this will solve your problem ..
And don't forget to push the changes to the code base 😬

Maybe we should add documentation for this too @mykola-mokhnach

@uterator
Copy link

uterator commented Oct 4, 2019

Hi all, was having the Drawable issue, was able to avoiding it but now getting the "lifecycleEventObserver" exception

@aldochristiaan the proguard rules are added as you have mentioned but it again doesn't work.

[debug] [Espresso] [Instrumentation] [STDOUT] io.appium.espressoserver.EspressoServerRunnerTest:
[debug] [Espresso] [Instrumentation] [STDOUT] Process crashed while executing startEspressoServer(io.appium.espressoserver.EspressoServerRunnerTest):
[debug] [Espresso] [Instrumentation] [STDOUT] java.lang.NoSuchMethodError: No static method lifecycleEventObserver(Ljava/lang/Object;)Landroidx/lifecycle/LifecycleEventObserver; in class Landroidx/lifecycle/Lifecycling; or its super classes (declaration of 'androidx.lifecycle.Lifecycling' appears in /data/app/io.appium.espressoserver.test-l340DT-NCWyyYyc8AudUKg==/base.apk)
[debug] [Espresso] [Instrumentation] [STDOUT]   at androidx.lifecycle.LifecycleRegistry$ObserverWithState.<init>(LifecycleRegistry.java:354)
[debug] [Espresso] [Instrumentation] [STDOUT]   at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:170)
[debug] [Espresso] [Instrumentation] [STDOUT]   at androidx.activity.ComponentActivity.<init>(ComponentActivity.java:94)
[debug] [Espresso] [Instrumentation] [STDOUT]   at androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:127)
[debug] [Espresso] [Instrumentation] [STDOUT]   at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:77)
[debug] [Espresso] [Instrumentation] [STDOUT]   at com.facebook.react.ReactActivity.<init>(ReactActivity.java:29)
[debug] [Espresso] [Instrumentation] [STDOUT]   at prod.android.MainActivity.<init>(MainActivity.java:15)
[debug] [Espresso] [Instrumentation] [STDOUT]   at java.lang.Class.newInstance(Native Method)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
[debug] [Espresso] [Instrumentation] [STDOUT]   at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:41)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.Instrumentation.newActivity(Instrumentation.java:1243)
[debug] [Espresso] [Instrumentation] [STDOUT]   at androidx.test.runner.MonitoringInstrumentation.newActivity(MonitoringInstrumentation.java:789)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3182)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.os.Handler.dispatchMessage(Handler.java:107)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.os.Looper.loop(Looper.java:214)
[debug] [Espresso] [Instrumentation] [STDOUT]   at android.app.ActivityThread.main(ActivityThread.java:7356)
[debug] [Espresso] [Instrumentation] [STDOUT]   at java.lang.reflect.Method.invoke(Native Method)
[debug] [Espresso] [Instrumentation] [STDOUT]   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
[debug] [Espresso] [Instrumentation] [STDOUT]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
[WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"}
[debug] [Espresso] Deleting espresso session
[debug] [ADB] Running 'C:\Users\User\AppData\Local\Android\sdk\platform-tools\adb.exe -P 5037 -s emulator-5556 shell am force-stop prod.android.dev'
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_RESULT: shortMsg=Process crashed.
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_CODE: 0
[Espresso] Instrumentation process exited with code 0 from signal null
[debug] [Logcat] Stopping logcat capture

@tinder-ktarasov
Copy link
Contributor

Also some resource related failures may be because Espresso driver server APK doesn't have some application dependencies. I'm implementing the related feature as part of #496
You can check if this is the case by building Espresso driver server inside androidTest directory of your app (i.e. by building it as if it was an Espresso test for your app). Note that you'll need to add dependencies from https://github.com/appium/appium-espresso-driver/blob/master/espresso-server/app/build.gradle#L63-L72 (and Kotlin lines too if Kotlin is not used in your app).

@dchhetri
Copy link

dchhetri commented Oct 29, 2019

Also getting error related to no static method as @uterator and @poojachoudhary13 mentioned

java.lang.NoSuchMethodError: No static method 
lifecycleEventObserver(Ljava/lang/Object;)Landroidx/lifecycle/LifecycleEventObserver;
in class Landroidx/lifecycle/Lifecycling; or its super classes 
(declaration of 'androidx.lifecycle.Lifecycling' appears in
/data/app/io.appium.espressoserver.test-6bb7cMrxFzYSiKy3KnWDzw==/base.apk)

I get that error after rebuilding espresso server with the changes listed by @TarCV with the proguard rules applied. The error is present when testing my app in both Debug and Release mode. I'm using the latest appium-espressor-driver with latest Appium - 1.16.0-beta.1. I've tried wiping emulator data and starting from scratch but get the same issue.

Any other thoughts on ways to proceed here?

EDIT:

If it helps it looks like it could be due to 3rd party dependencies? Looking at the stack trace for me

[debug] [Espresso] [Instrumentation] [STDOUT] java.lang.NoSuchMethodError: No static method...

[debug] [Espresso] [Instrumentation] [STDOUT]   at 
androidx.lifecycle.LifecycleRegistry$ObserverWithState.<init>(LifecycleRegistry.java:354)

[debug] [Espresso] [Instrumentation] [STDOUT]   at 
androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:170)

[debug] [Espresso] [Instrumentation] [STDOUT]   at
 androidx.activity.ComponentActivity.<init>(ComponentActivity.java:94)

[debug] [Espresso] [Instrumentation] [STDOUT]   at
 androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:127)

[debug] [Espresso] [Instrumentation] [STDOUT]   at 
androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:77)

[debug] [Espresso] [Instrumentation] [STDOUT]   at 
com.reactnativenavigation.NavigationActivity.<init>(NavigationActivity.java:26)

I see that reactnativenavigation starts the NavigationActivity, could it be possible that their code is not compatible with the sdk version we're using or something of that sort? This is all new to me, so trying to grasp few things here still.

@dchhetri
Copy link

dchhetri commented Oct 30, 2019

I found a fix for the lifecycle errors. In the espresso-server/app/build.gradle file, I had to add the following deps according to the docs

def lifecycle_version = "2.1.0"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"

@uterator
Copy link

I found a fix for the lifecycle errors. In the espresso-server/app/build.gradle file, I had to add the following deps according to the docs

def lifecycle_version = "2.1.0"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"

Great, that really solves the lifecycle errors

@uterator
Copy link

uterator commented Oct 31, 2019

Here are the dependencies which work, no Drawable or Lifecycle errors are stopping the execution anymore

   ext.espresso_version = "3.2.0"
   ext.testlib_version = "1.2.0"
   ext.mocklib_version = "1.7.4"
   ext.lifecycle_version = "2.1.0"
   
   implementation fileTree(dir: 'libs', include: ['*.jar'])
   implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"

   testImplementation "org.powermock:powermock-api-mockito2:$mocklib_version"
   testImplementation "org.powermock:powermock-classloading-xstream:$mocklib_version"
   testImplementation "org.powermock:powermock-module-junit4-rule:$mocklib_version"
   testImplementation "org.powermock:powermock-module-junit4:$mocklib_version"
   testImplementation "androidx.test.espresso:espresso-contrib:$espresso_version"
   testImplementation "androidx.test.espresso:espresso-core:$espresso_version"

   testImplementation ("androidx.test.espresso:espresso-web:$espresso_version"){
        exclude group: 'androidx.test.espresso'
   }

   testImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
   testImplementation "androidx.test:core:$testlib_version"
   testImplementation "androidx.test:runner:$testlib_version"
   testImplementation "androidx.test:rules:$testlib_version"
   testImplementation 'com.google.code.gson:gson:2.8.5'
   testImplementation 'javax.ws.rs:jsr311-api:1.1.1'
   testImplementation 'junit:junit:4.12'
   testImplementation 'org.mockito:mockito-core:2.8.9'
   testImplementation 'org.nanohttpd:nanohttpd-webserver:2.3.1'
   testImplementation 'org.robolectric:robolectric:4.0.2'
   testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
   testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
   testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

   androidTestImplementation("androidx.test.espresso:espresso-contrib:$espresso_version") {
       transitive = false
   }

   androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
   androidTestImplementation "androidx.test.espresso:espresso-web:$espresso_version"
   androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
   androidTestImplementation "androidx.test:core:$testlib_version"
   androidTestImplementation "androidx.test:runner:$testlib_version"
   androidTestImplementation "androidx.test:rules:$testlib_version"
   androidTestImplementation 'com.google.code.gson:gson:2.8.5'
   androidTestImplementation 'javax.ws.rs:jsr311-api:1.1.1'
   androidTestImplementation 'org.nanohttpd:nanohttpd-webserver:2.3.1'
   androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
   androidTestImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
   androidTestImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

@mykola-mokhnach
Copy link
Contributor

@uterator would you mind creating a PR?

@nathiyatesting
Copy link

nathiyatesting commented Nov 20, 2019

@aldochristiaan @hunzai @uterator @dchhetri Am facing the same problem of 'Caused by: android.content.res.Resources$NotFoundException: Resource xxxx (7f070059) is not a Drawable (color or path): TypedValue{t=0x5/d=0x3e01 a=2 r=0x7f070059}.

and also having this error
Got an error during apksigner execution: Command '/usr/local/share/android/sdk/build-tools/29.0.0-rc3/apksigner verify --print-certs /var/folders/qv/0jx6zk2s2sx4h0x4vypksn84zc27mv/T/io.appium.espressoserver.test_1.16.0_bet.thescore.android.debug.apk' exited with code 1
2019-11-20 11:20:32:333 [ADB] apksigner stderr: DOES NOT VERIFY
'ERROR: JAR signer CERT.RSA: JAR signature META-INF/CERT.SF indicates the APK is signed using APK Signature Scheme v2 but no such signature was found. Signature stripped?

I followed the solutions that is mentioned above but not able to locate the build.gradle file under this path '/usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/espresso-server/app' . Do we need to create a build.gradle file. Am not sure of what should be done. Am new to use the espresso driver appium. Any help is really appreciated.

@nathiyatesting
Copy link

nathiyatesting commented Nov 21, 2019

Atleast I am running into a different problem 😄

[Espresso] Installed Espresso Test Server apk '/var/folders/vq/wtd54njj5hb_nykcwfmh0xwdfzl9mm/T/io.appium.espressoserver.test_1.16.0_com.company.app.company.apk' (pkg: 'io.appium.espressoserver.test')
[debug] [Espresso] Performing cleanup of automation leftovers
[debug] [Espresso] No obsolete sessions have been detected (Error: socket hang up)
[Espresso] Starting Espresso Server v1.16.0 with cmd: adb shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","-e","debug","false","io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner"]
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_RESULT: shortMsg=Process crashed.
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_CODE: 0
[Espresso] Instrumentation process exited with code 0 from signal null
[debug] [Espresso] Deleting espresso session
[debug] [ADB] Running '/Users/amjad.saleem/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus enable'
[debug] [ADB] Running '/Users/amjad.saleem/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.company.app.company'
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8300 
[debug] [ADB] Running '/Users/USER/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp\:8300'
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1570116157644 (17:22:37 GMT+0200 (Central European Summer Time))
[debug] [W3C] Encountered internal error running command: Error: The process did not start within 30000ms (cmd: '/Users/USER/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner')
[debug] [W3C]     at Timeout.setTimeout (/Users/USER/projects/rn-app/node_modules/appium/node_modules/teen_process/lib/subprocess.js:197:18)
[debug] [W3C]     at ontimeout (timers.js:436:11)
[debug] [W3C]     at tryOnTimeout (timers.js:300:5)
[debug] [W3C]     at listOnTimeout (timers.js:263:5)
[debug] [W3C]     at Timer.processTimers (timers.js:223:10)
[HTTP] <-- POST /wd/hub/session 500 43777 ms - 1021
[HTTP] 
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"alwaysMatch":{"appium:deviceName":"emulator-5554","platformName":"Android","appium:platformVersion":"8.0","appium:language":"en","appium:locale":"DE","appium:automationName":"Espresso","appium:app":"/Users/USER/projects/rn-app/android/app/build/outputs/apk/debug/app-debug.apk","appium:newCommandTimeout":60,"appium:unicodeKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"appium:deviceName":"emulator-5554","platformName":"Android","appium:platformVersion":"8.0","appium:language":"en","appium:locale":"DE","appium:automationName":"Espresso","appium:app":"/Users/USER/projects/rn-app/android/app/build/outputs/apk/debug/app-debug.apk","appium:newCommandTimeout":60,"appium:unicodeKeyboard":true}}

crashing on following line

/Users/USER/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner INSTRUMENTATION_RESULT: shortMsg=Process crashed. INSTRUMENTATION_CODE: 0

@aldochristiaan First I got the 'Resources$NotFoundException Resource is not a Drawable error' as mentioned in the start of the thread by @copolii . Then used this apk 'debug-androidTest.apk.zip ' apk posted by @aldochristiaan. This error message Resources$NotFoundException Resource is not a Drawable error' is fixed but getting
the error posted by @hunzai .

crashing on following line

/Users/USER/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner INSTRUMENTATION_RESULT: shortMsg=Process crashed. INSTRUMENTATION_CODE: 0

Can you guys please help me @hunzai @aldochristiaan @copolii . Sorry for asking so much. Am new to espresso. So don't have any idea.

@nathiyatesting
Copy link

@aldochristiaan Does Android developer has added the espresso test dependencies in the app?

@tinder-ktarasov
Copy link
Contributor

It should be possible to fix this issue with espressoBuildConfig capability (just added PR with docs on it - appium/appium#13766) and a config like this (if an app under test uses material components):

{
  "additionalAppDependencies": [
    "com.google.android.material:material:1.0.0",
    "androidx.lifecycle:lifecycle-extensions:2.1.0"
  ]
}

lifecycle-extensions line is based on fix by @uterator and perhaps it is not needed when there is no errors related to lifecycle classes.

@hiqqs
Copy link

hiqqs commented Jan 13, 2020

I'm getting a very similar error in my application:
[Espresso] [Instrumentation] [STDOUT] android.content.res.Resources$NotFoundException: Drawable com.hqo:dimen/ame_default_cluster_text_shadow_offset_x with resource ID #0x7f070059

I had used Espresso before no problem and it was sooooo nice. UiAutomator2 has been insanely slow for some reason and I would love to use this framework again, i've tried various things from above with no luck any help is super appreciated

@NoelOmo
Copy link

NoelOmo commented Feb 27, 2020

  • disabled transitive dependencies for espresso-contrib

I've managed to fix it for our app by changing this driver:

  • changed all SDK versions in both build.gradle and server manifest to match versions in AUT
  • disabled transitive dependencies for espresso-contrib (I guess these dependencies are main cause for this issue)
  • excluded androidx.test.espresso group from transitive dependencies of espresso-web

Overall I think Android build process is too complex to have espresso server setup as simple as it is now. I'd be much more confident in the server if it had most android dependencies compileOnly and its manifest were generated based on AUT manifest.

Two questions @TarCV ,

  1. Could you share sample build.gradle files that have these changes?
  2. Which app Im I supposed to make these changes in?

@uterator
Copy link

To solve Drawable and lifecycle errors I tried the same approach which worked for Espresso driver 1.16 and it worked for Espresso driver 1.23.2 too. But I guess it can be project specific.
However, this is the build.gradle (in zip) to locate in npm\node_modules\appium\node_modules\appium-espresso-driver\espresso-server\app.
After that, tests work for me. No need to build the project separately and replace the apk.
Set showGradleLog capability to see Gradle rebuild process logs before espresso driver is installed on device and started.
When the Gradle build is finished you should find app-debug-androidTest.apk in build\outputs\apk\androidTest\debug. It should be about 2.7 MB, the original apk is 4.7 MB.
Before you try, make sure nothing from Espresso driver exists on device/emulator. If you are using emulator, just start it with -wip-data argument.

@claraSpark
Copy link

Hi, i want to ask about how to use this appium with espresso driver. Do we have to add espresso dependencies in the android application?

@rasim-sitmanbetov
Copy link
Contributor

rasim-sitmanbetov commented Sep 28, 2020

Hi,

I'd like to share my experience with solving this issue.
Per my understanding, True that the main reason affecting all AUTs (or most of them) is transitive dependencies of espresso-contrib, which were fixed with the help of:

There were also 2 other PRs, which among other changes, also disabled transitive dependencies as previous PR. But these pulls were closed for some reason:

2 out of 3 PRs also introduced different changes in dependencies:

So, looks like we have 1 common reason, and several reasons specific for AUT. In case of our application, we required next additional changes on top of the current latest version of espresso-server/app/build.gradle (please see #610)

  • added implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
  • changed androidTestImplementation "com.google.android.material:material:1.2.0" to implementation "com.google.android.material:material:1.2.0".

It was assumed by @glebplotnikovring and @TarCV that the build process of the espresso-server app could be modified. Like in #496, it could be possible to specify/override dependencies at the build phase, thus all AUT specific dependencies should never be merged into mainline.

All ideas and thoughts on this topic are highly appreciated.

Thanks

@uterator
Copy link

As for now, I am passing this data in a file to espressoBuildConfig capability, and it works as nothing had happened.

{
  "toolsVersions": {
    "gradle": "5.1.1",
    "androidGradlePlugin": "3.4.2",
    "compileSdk": 28,
    "buildTools": "28.0.3",
    "minSdk": 18,
    "targetSdk": 28,
    "kotlin": "1.3.31"
  },
  "additionalAppDependencies": [
    "androidx.lifecycle:lifecycle-extensions:2.2.0"
  ]
}

@jaroslawjalocha
Copy link

Hello, I have a problem with starts appium inspector:
,,Failed to create session. A new session could not be created. Details: Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.''

My capabilities:
{
"platformName": "Android",
"appium:automationName": "espresso",
"appium:udid": "711KPQJ0619700",
"appium:appPackage": "name_app",
"appium:appActivity": "name_app_main_activity",
"appium:autoGrantPermissions": true,
"appium:dontStopAppOnReset": true,
"appium:noReset": true
}
Appium v1.22.3
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

Logs from appium:
[info] �[35m[Appium]�[39m Welcome to Appium v1.22.3
[info] �[35m[Appium]�[39m Non-default server args:
[info] �[35m[Appium]�[39m relaxedSecurityEnabled: true
[info] �[35m[Appium]�[39m allowInsecure: {
[info] �[35m[Appium]�[39m }
[info] �[35m[Appium]�[39m denyInsecure: {
[info] �[35m[Appium]�[39m }
[info] �[35m[Appium]�[39m Appium REST http interface listener started on 0.0.0.0:4723[info] �[35m[HTTP]�[39m �[37m-->�[39m �[37mPOST�[39m �[37m/wd/hub/session�[39m
[info] �[35m[HTTP]�[39m �[90m{"capabilities":{"alwaysMatch":{"platformName":"Android","appium:automationName":"espresso","appium:udid":"711KPQJ0619700","appium:appPackage":"pl.wp.wppoczta.test","appium:appActivity":"pl.wp.ui_root.MainActivity","appium:autoGrantPermissions":true,"appium:dontStopAppOnReset":true,"appium:noReset":true,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"Android","appium:automationName":"espresso","appium:udid":"711KPQJ0619700","appium:appPackage":"pl.wp.wppoczta.test","appium:appActivity":"pl.wp.ui_root.MainActivity","appium:autoGrantPermissions":true,"appium:dontStopAppOnReset":true,"appium:noReset":true,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true}}�[39m
[debug] �[35m[W3C]�[39m Calling AppiumDriver.createSession() with args: [{"platformName":"Android","appium:automationName":"espresso","appium:udid":"711KPQJ0619700","appium:appPackage":"pl.wp.wppoczta.test","appium:appActivity":"pl.wp.ui_root.MainActivity","appium:autoGrantPermissions":true,"appium:dontStopAppOnReset":true,"appium:noReset":true,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},null,{"alwaysMatch":{"platformName":"Android","appium:automationName":"espresso","appium:udid":"711KPQJ0619700","appium:appPackage":"pl.wp.wppoczta.test","appium:appActivity":"pl.wp.ui_root.MainActivity","appium:autoGrantPermissions":true,"appium:dontStopAppOnReset":true,"appium:noReset":true,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]}]
[debug] �[35m[BaseDriver]�[39m Event 'newSessionRequested' logged at 1663572737076 (09:32:17 GMT+0200 (Central European Summer Time))
[info] �[35m[Appium]�[39m Appium v1.22.3 creating new EspressoDriver (v1.45.3) session
[info] �[35m[Appium]�[39m Applying relaxed security to 'EspressoDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[debug] �[35m[BaseDriver]�[39m W3C capabilities and MJSONWP desired capabilities were provided
[debug] �[35m[BaseDriver]�[39m Creating session with W3C capabilities: {
[debug] �[35m[BaseDriver]�[39m "alwaysMatch": {
[debug] �[35m[BaseDriver]�[39m "platformName": "Android",
[debug] �[35m[BaseDriver]�[39m "appium:automationName": "espresso",
[debug] �[35m[BaseDriver]�[39m "appium:udid": "711KPQJ0619700",
[debug] �[35m[BaseDriver]�[39m "appium:appPackage": "pl.wp.wppoczta.test",
[debug] �[35m[BaseDriver]�[39m "appium:appActivity": "pl.wp.ui_root.MainActivity",
[debug] �[35m[BaseDriver]�[39m "appium:autoGrantPermissions": true,
[debug] �[35m[BaseDriver]�[39m "appium:dontStopAppOnReset": true,
[debug] �[35m[BaseDriver]�[39m "appium:noReset": true,
[debug] �[35m[BaseDriver]�[39m "appium:ensureWebviewsHavePages": true,
[debug] �[35m[BaseDriver]�[39m "appium:nativeWebScreenshot": true,
[debug] �[35m[BaseDriver]�[39m "appium:newCommandTimeout": 3600,
[debug] �[35m[BaseDriver]�[39m "appium:connectHardwareKeyboard": true
[debug] �[35m[BaseDriver]�[39m },
[debug] �[35m[BaseDriver]�[39m "firstMatch": [
[debug] �[35m[BaseDriver]�[39m {}
[debug] �[35m[BaseDriver]�[39m ]
[debug] �[35m[BaseDriver]�[39m }
[warn] �[35m[BaseDriver]�[39m The following capabilities were provided, but are not recognized by Appium:
[warn] �[35m[BaseDriver]�[39m connectHardwareKeyboard
[info] �[35m[BaseDriver]�[39m Session created with session id: 4fc1bfd2-0b77-4bc8-a189-444e33f2b889[info] �[35m[ADB]�[39m Found 2 'build-tools' folders under '/Users/neontri-jj/Library/Android/sdk' (newest first):
[info] �[35m[ADB]�[39m /Users/neontri-jj/Library/Android/sdk/build-tools/30.0.3
[info] �[35m[ADB]�[39m /Users/neontri-jj/Library/Android/sdk/build-tools/29.0.2
[info] �[35m[ADB]�[39m Using 'adb' from '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 start-server'[info] �[35m[AndroidDriver]�[39m Retrieving device list
[debug] �[35m[ADB]�[39m Trying to find a connected android device
[debug] �[35m[ADB]�[39m Getting connected devices
[debug] �[35m[ADB]�[39m Connected devices: [{"udid":"711KPQJ0619700","state":"device"}]
[info] �[35m[AndroidDriver]�[39m Using device: 711KPQJ0619700
[info] �[35m[ADB]�[39m Using 'adb' from '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 start-server'
[debug] �[35m[ADB]�[39m Setting device id to 711KPQJ0619700
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell getprop ro.build.version.sdk'[debug] �[35m[ADB]�[39m Current device property 'ro.build.version.sdk': 30
[info] �[35m[ADB]�[39m Getting device platform version
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell getprop ro.build.version.release'
[debug] �[35m[ADB]�[39m Current device property 'ro.build.version.release': 11
[debug] �[35m[ADB]�[39m Device API level: 30
[warn] �[35m[Espresso]�[39m Relaxing hidden api policy
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1''[warn] �[35m[AndroidDriver]�[39m No app sent in, not parsing package/activity
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 wait-for-device'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell echo ping'
[debug] �[35m[AndroidDriver]�[39m Pushing settings apk to device...
[debug] �[35m[ADB]�[39m Getting install status for io.appium.settings
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell dumpsys package io.appium.settings'[debug] �[35m[ADB]�[39m 'io.appium.settings' is installed
[debug] �[35m[ADB]�[39m Getting package info for 'io.appium.settings'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell dumpsys package io.appium.settings'[debug] �[35m[ADB]�[39m The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.4.0' >= '3.4.0')
[debug] �[35m[ADB]�[39m There is no need to install/upgrade '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[debug] �[35m[ADB]�[39m Getting IDs of all 'io.appium.settings' processes
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell 'pgrep --help; echo $?''
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)'[debug] �[35m[AndroidDriver]�[39m io.appium.settings is already running. There is no need to reset its permissions.
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell appops set io.appium.settings android:mock_location allow'[debug] �[35m[Logcat]�[39m Starting logs capture with command: /Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 logcat -v threadtime
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell settings get global animator_duration_scale'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell settings get global transition_animation_scale'[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell settings get global window_animation_scale'
[debug] �[35m[Espresso]�[39m Forwarding Espresso Server port 6791 to 8300
[debug] �[35m[ADB]�[39m Forwarding system: 8300 to device: 6791
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 forward tcp:8300 tcp:6791'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell dumpsys window'[info] �[35m[AndroidDriver]�[39m Screen already unlocked, doing nothing
[debug] �[35m[Espresso]�[39m No app capability. Assuming it is already on the device
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell "[ -e '/data/local/tmp/espresso.apppackage' ] && echo PASS"'
[debug] �[35m[Espresso]�[39m The previous target application package is unknown
[info] �[35m[Espresso]�[39m Forcing Espresso server rebuild because of changed application package
[info] �[35m[Espresso]�[39m Building espresso server in '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/espresso-server-711KPQJ0619700'
[debug] �[35m[Espresso]�[39m The build folder root could be customized by changing the 'tmpDir' capability
[debug] �[35m[Espresso]�[39m Copying espresso server template from ('/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-espresso-driver/espresso-server' to '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/espresso-server-711KPQJ0619700')[debug] �[35m[Espresso]�[39m Bulding espresso server
[debug] �[35m[Espresso]�[39m Beginning build with command './gradlew -PappiumTargetPackage=pl.wp.wppoczta.test app:assembleAndroidTest' in directory '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/espresso-server-711KPQJ0619700'
[debug] �[35m[Espresso]�[39m Output from Gradle will not be logged. To change this, use 'showGradleLog' desired capability[debug] �[35m[Espresso]�[39m Copying built apk from '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/espresso-server-711KPQJ0619700/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk' to '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk'
[debug] �[35m[ADB]�[39m Checking app cert for /var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk
[info] �[35m[ADB]�[39m Using 'apksigner.jar' from '/Users/neontri-jj/Library/Android/sdk/build-tools/30.0.3/lib/apksigner.jar'
[debug] �[35m[ADB]�[39m Starting apksigner: /Users/neontri-jj/.sdkman/candidates/java/current/bin/java -Xmx1024M -Xss1m -jar /Users/neontri-jj/Library/Android/sdk/build-tools/30.0.3/lib/apksigner.jar verify --print-certs /var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk[debug] �[35m[ADB]�[39m apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] �[35m[ADB]�[39m Signer #1 certificate SHA-256 digest: 2d7bcb6f88825afc6b1b682d000baf0b15046b774c09c35762f405d51317f820
[debug] �[35m[ADB]�[39m Signer #1 certificate SHA-1 digest: df5a5faed2303f035deb7502271c2a70a7c47afc
[debug] �[35m[ADB]�[39m Signer #1 certificate MD5 digest: 72dd48a812d132dac52b106b5d2ce2e0
[debug] �[35m[ADB]�[39m
[info] �[35m[ADB]�[39m '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk' is signed with a non-default certificate
[info] �[35m[ADB]�[39m Using 'zipalign' from '/Users/neontri-jj/Library/Android/sdk/build-tools/30.0.3/zipalign'[debug] �[35m[ADB]�[39m /var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk' is already zip-aligned. Doing nothing
[debug] �[35m[ADB]�[39m Signing '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk' with default cert
[debug] �[35m[ADB]�[39m Starting apksigner: /Users/neontri-jj/.sdkman/candidates/java/current/bin/java -Xmx1024M -Xss1m -jar /Users/neontri-jj/Library/Android/sdk/build-tools/30.0.3/lib/apksigner.jar sign --key '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8' --cert '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem' /var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk[debug] �[35m[ADB]�[39m Uninstalling io.appium.espressoserver.test
[debug] �[35m[ADB]�[39m Getting install status for io.appium.espressoserver.test
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell dumpsys package io.appium.espressoserver.test'[debug] �[35m[ADB]�[39m 'io.appium.espressoserver.test' is installed
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell am force-stop io.appium.espressoserver.test'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 uninstall io.appium.espressoserver.test'[debug] �[35m[ADB]�[39m 'adb uninstall io.appium.espressoserver.test' command output: Success
[info] �[35m[ADB]�[39m io.appium.espressoserver.test was successfully uninstalled
[info] �[35m[Espresso]�[39m Uninstalled the obsolete Espresso server package from the device under test
[debug] �[35m[ADB]�[39m Getting install status for io.appium.espressoserver.test
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell dumpsys package io.appium.espressoserver.test'
[debug] �[35m[ADB]�[39m 'io.appium.espressoserver.test' is not installed
[debug] �[35m[ADB]�[39m App '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk' is not installed
[info] �[35m[Espresso]�[39m Installing Espresso Test Server apk from the target device (path: '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk')
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 help'
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 features'[info] �[35m[ADB]�[39m The application at '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk' will not be cached, because the device under test has confirmed the support of streamed installs
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 install /var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk'[info] �[35m[ADB]�[39m The installation of 'io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk' took 15750ms
[debug] �[35m[ADB]�[39m Install command stdout: Serving...
[debug] �[35m[ADB]�[39m Performing Incremental Install
[debug] �[35m[ADB]�[39m
[debug] �[35m[ADB]�[39m Exception occurred while executing 'install-incremental':
[debug] �[35m[ADB]�[39m java.lang.IllegalArgumentException: Incremental i...
[debug] �[35m[ADB]�[39m at android.os.Binder.execTransactInternal(Binder.java:1159)
[debug] �[35m[ADB]�[39m at android.os.Binder.execTransact(Binder.java:1123)
[debug] �[35m[ADB]�[39m Performing Streamed Install
[debug] �[35m[ADB]�[39m Success
[info] �[35m[Espresso]�[39m Installed Espresso Test Server apk '/var/folders/nb/0yrg6yd92d98cz64c5wqq1380000gn/T/io.appium.espressoserver.test_1.45.3_pl.wp.wppoczta.test_711KPQJ0619700.apk' (pkg: 'io.appium.espressoserver.test')
[info] �[35m[ADB]�[39m Adding packages ["io.appium.settings","io.appium.espressoserver.test"] to Doze whitelist
[debug] �[35m[ADB]�[39m Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.espressoserver.test",";"]]
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.espressoserver.test ;'
[debug] �[35m[Espresso]�[39m Performing cleanup of automation leftovers
[debug] �[35m[Espresso]�[39m No obsolete sessions have been detected (socket hang up)
[info] �[35m[Espresso]�[39m Starting Espresso Server v1.45.3 with cmd: adb shell am instrument -w -e debug false -e disableAnalytics true io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner
[debug] �[35m[ADB]�[39m Creating ADB subprocess with args: ["-P",5037,"-s","711KPQJ0619700","shell","am","instrument","-w","-e","debug",false,"-e","disableAnalytics",true,"io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner"]
[info] �[35m[Espresso]�[39m Waiting up to 45000ms for Espresso server to be online
[debug] �[35m[WD Proxy]�[39m Matched '/status' to command name 'getStatus'
[debug] �[35m[WD Proxy]�[39m Proxying [GET /status] to [GET http://localhost:8300/status] with no body
[info] �[35m[WD Proxy]�[39m socket hang up[debug] �[35m[Espresso]�[39m [Instrumentation] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=14232, uid=14232 not allowed because package io.appium.espressoserver.test does not have a signature matching the target pl.wp.wppoczta.test
[debug] �[35m[Espresso]�[39m [Instrumentation] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=14232, uid=14232 not allowed because package io.appium.espressoserver.test does not have a signature matching the target pl.wp.wppoczta.test
[debug] �[35m[Espresso]�[39m INSTRUMENTATION_STATUS: id=ActivityManagerService
[debug] �[35m[Espresso]�[39m INSTRUMENTATION_STATUS_CODE: -1
[debug] �[35m[Espresso]�[39m [Instrumentation] at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
[debug] �[35m[Espresso]�[39m at android.os.Parcel.createException(Parcel.java:2357)
[debug] �[35m[Espresso]�[39m at android.os.Parcel.readException(Parcel.java:2340)
[debug] �[35m[Espresso]�[39m at android.os.Parcel.readException(Parcel.java:2282)
[debug] �[35m[Espresso]�[39m at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:6090)
[debug] �[35m[Espresso]�[39m at com.android.commands.am.Instrument.run(Instrument.java:517)
[debug] �[35m[Espresso]�[39m at com.android.commands.am.Am.runInstrument(Am.java:202)
[debug] �[35m[Espresso]�[39m at com.android.commands.am.Am.onRun(Am.java:80)
[debug] �[35m[Espresso]�[39m at com.android.internal.os.BaseCommand.run(BaseCommand.java:60)
[debug] �[35m[Espresso]�[39m at com.android.commands.am.Am.main(Am.java:50)
[debug] �[35m[Espresso]�[39m at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[debug] �[35m[Espresso]�[39m at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
[debug] �[35m[Espresso]�[39m Caused by: android.os.RemoteException: Remote stack trace:
[debug] �[35m[Espresso]�[39m at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:16922)
[debug] �[35m[Espresso]�[39m at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2655)
[debug] �[35m[Espresso]�[39m at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2883)
[debug] �[35m[Espresso]�[39m at android.os.Binder.execTransactInternal(Binder.java:1154)
[debug] �[35m[Espresso]�[39m at android.os.Binder.execTransact(Binder.java:1123)
[info] �[35m[Espresso]�[39m Instrumentation process exited with code 1 from signal null
[error] �[35m[Espresso]�[39m Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details
[debug] �[35m[Espresso]�[39m Deleting espresso session
[debug] �[35m[Logcat]�[39m Stopping logcat capture
[info] �[35m[Espresso]�[39m Restoring hidden api policy to the device default configuration
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''[debug] �[35m[ADB]�[39m Removing forwarded port socket connection: 8300
[debug] �[35m[ADB]�[39m Running '/Users/neontri-jj/Library/Android/sdk/platform-tools/adb -P 5037 -s 711KPQJ0619700 forward --remove tcp:8300'
[debug] �[35m[BaseDriver]�[39m Event 'newSessionStarted' logged at 1663572788052 (09:33:08 GMT+0200 (Central European Summer Time))
[debug] �[35m[W3C]�[39m Encountered internal error running command: A new session could not be created. Details: Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] �[35m[W3C]�[39m Error: Espresso server process has been unexpectedly terminated. Check the Appium server log and the logcat output for more details. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] �[35m[W3C]�[39m at Object.errorAndThrow (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:94:35)
[debug] �[35m[W3C]�[39m at condFn (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-espresso-driver/lib/espresso-runner.js:283:18)
[debug] �[35m[W3C]�[39m at spin (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:138:26)
[debug] �[35m[W3C]�[39m at spin (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:148:20)
[debug] �[35m[W3C]�[39m at waitForCondition (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:155:10)
[debug] �[35m[W3C]�[39m at EspressoRunner.startSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-espresso-driver/lib/espresso-runner.js:277:7)
[debug] �[35m[W3C]�[39m at EspressoDriver.startEspressoSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-espresso-driver/lib/driver.js:318:5)
[debug] �[35m[W3C]�[39m at EspressoDriver.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-espresso-driver/lib/driver.js:188:7)
[debug] �[35m[W3C]�[39m at AppiumDriver.createSession (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/lib/appium.js:387:35)
[info] �[35m[HTTP]�[39m �[37m<-- POST /wd/hub/session �[39m�[31m500�[39m �[90m50981 ms - 2042�[39m
[info] �[35m[HTTP]�[39m �[90m�[39m

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

Successfully merging a pull request may close this issue.