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

Apksigner of espressoserver apk failed: code 1 #552

Closed
wiensmit opened this issue Mar 4, 2020 · 16 comments
Closed

Apksigner of espressoserver apk failed: code 1 #552

wiensmit opened this issue Mar 4, 2020 · 16 comments

Comments

@wiensmit
Copy link

wiensmit commented Mar 4, 2020

Hello everyone,

I keep running into the problem that the signing of the espressoserver apk fails, can't really see what im doing wrong since everything works just fine when i use UIAnimator2, however we want to use tags for android with only seems to be possible with espresso.

I have tried running appium with root access but this doesn't seem to solve anything either.
I put my logs down below, maybe someone notices something that i missed.

[HTTP] {"capabilities":{"firstMatch":[{"appium:iosInstallPause":"8000","appium:udid":"RF8M204GZ1P","appium:noReset":"true","appium:xcodeorgid":"JB3BDGC96R","appium:wdaStartupRetryInterval":"20000","appium:automationName":"Espresso","appium:xcodesigningid":"iPhone Developer","appium:app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","appium:wdaStartupRetries":"4","appium:deviceName":"Galaxy S10","appium:platformVersion":"10","appium:maxTypingFrequency":"3000","platformName":"android"}]},"desiredCapabilities":{"deviceName":"Galaxy S10","xcodeorgid":"JB3BDGC96R","udid":"RF8M204GZ1P","automationName":"Espresso","noReset":"true","wdaStartupRetries":"4","iosInstallPause":"8000","xcodesigningid":"iPhone Developer","platformVersion":"10","wdaStartupRetryInterval":"20000","platformName":"android","app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","maxTypingFrequency":"3000"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"Galaxy S10","xcodeorgid":"JB3BDGC96R","udid":"RF8M204GZ1P","automationName":"Espresso","noReset":"true","wdaStartupRetries":"4","iosInstallPause":"8000","xcodesigningid":"iPhone Developer","platformVersion":"10","wdaStartupRetryInterval":"20000","platformName":"android","app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","maxTypingFrequency":"3000"},null,{"firstMatch":[{"appium:iosInstallPause":"8000","appium:udid":"RF8M204GZ1P","appium:noReset":"true","appium:xcodeorgid":"JB3BDGC96R","appium:wdaStartupRetryInterval":"20000","appium:automationName":"Espresso","appium:xcodesigningid":"iPhone Developer","appium:app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","appium:wdaStartupRetries":"4","appium:deviceName":"Galaxy S10","appium:platformVersion":"10","appium:maxTypingFrequency":"3000","platformName":"android"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1583324871569 (13:27:51 GMT+0100 (Central European Standard Time))
[Appium] Appium v1.16.0 creating new EspressoDriver (v1.18.0) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "android",
[debug] [BaseDriver]     "appium:iosInstallPause": "8000",
[debug] [BaseDriver]     "appium:udid": "RF8M204GZ1P",
[debug] [BaseDriver]     "appium:noReset": "true",
[debug] [BaseDriver]     "appium:xcodeorgid": "JB3BDGC96R",
[debug] [BaseDriver]     "appium:wdaStartupRetryInterval": "20000",
[debug] [BaseDriver]     "appium:automationName": "Espresso",
[debug] [BaseDriver]     "appium:xcodesigningid": "iPhone Developer",
[debug] [BaseDriver]     "appium:app": "/Users/w.smit/Documents/censored_appium/apk/censored.apk",
[debug] [BaseDriver]     "appium:wdaStartupRetries": "4",
[debug] [BaseDriver]     "appium:deviceName": "Galaxy S10",
[debug] [BaseDriver]     "appium:platformVersion": "10",
[debug] [BaseDriver]     "appium:maxTypingFrequency": "3000"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   iosInstallPause
[BaseDriver]   xcodeorgid
[BaseDriver]   wdaStartupRetryInterval
[BaseDriver]   xcodesigningid
[BaseDriver]   wdaStartupRetries
[BaseDriver]   maxTypingFrequency
[BaseDriver] Session created with session id: a8d608b6-9862-4c27-8c09-262f575ab8b2
[BaseDriver] Using local app '/Users/w.smit/Documents/censored_appium/apk/censored.apk'
[debug] [Espresso] Checking whether app is actually present
[Espresso] EspressoDriver version: 1.18.0
[ADB] Using 'adb' from '/Users/w.smit/Library/Android/sdk/platform-tools/adb'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] Connected devices: [{"udid":"0422315063957000024f","state":"device"},{"udid":"RF8M204GZ1P","state":"device"}]
[AndroidDriver] Using device: RF8M204GZ1P
[ADB] Using 'adb' from '/Users/w.smit/Library/Android/sdk/platform-tools/adb'
[debug] [ADB] Setting device id to RF8M204GZ1P
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 29
[debug] [ADB] Device API level: 29
[Espresso] Relaxing hidden api policy
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy_pre_p_apps 1'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy_p_apps 1'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy 1'
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: 'nl.rtl.censored'
[ADB] Main activity name: 'nl.rtl.censored.ui.onboarding.OnboardingActivity'
[debug] [AndroidDriver] Parsed package and activity are: nl.rtl.censored/nl.rtl.censored.ui.onboarding.OnboardingActivity
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P wait-for-device'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.settings'
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('2.15.0' >= '2.15.0')
[debug] [ADB] There is no need to install/upgrade '/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell 'pgrep --help; echo $?''
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell pgrep -f io\\.appium\\.settings'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell appops set io.appium.settings android\:mock_location allow'
[debug] [Logcat] Starting logcat capture
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global animator_duration_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global transition_animation_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global window_animation_scale'
[debug] [Espresso] Forwarding Espresso Server port 6791 to 8300
[debug] [ADB] Forwarding system: 8300 to device: 6791
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P forward tcp\:8300 tcp\:6791'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Checking app cert for /Users/w.smit/Documents/censored_appium/apk/censored.apk
[ADB] Using 'apksigner' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner'
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/Users/w.smit/Documents/censored_appium/apk/censored.apk"]'
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB] 
[debug] [ADB] '/Users/w.smit/Documents/censored_appium/apk/censored.apk' is already signed.
[debug] [ADB] Getting install status for nl.rtl.censored
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package nl.rtl.censored'
[debug] [ADB] 'nl.rtl.censored' is installed
[debug] [ADB] Getting package info for 'nl.rtl.censored'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package nl.rtl.censored'
[debug] [ADB] The version name of the installed 'nl.rtl.censored' is greater or equal to the application version name ('4.1.3' >= '4.1.3')
[debug] [ADB] There is no need to install/upgrade '/Users/w.smit/Documents/censored_appium/apk/censored.apk'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell ls /data/local/tmp/espresso.apppackage'
[debug] [Espresso] The previous target application package is unknown
[Espresso] Forcing Espresso server rebuild because of changed application package
[debug] [Espresso] Deleting the obsolete Espresso server package '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk'
[Espresso] Building espresso server
[debug] [Espresso] build dir: /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server
[debug] [Espresso] Copying espresso server template from (/usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/espresso-server to /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server)
[debug] [Espresso] Beginning build with command './gradlew assembleAndroidTest' in directory '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server'
[debug] [Espresso] Output from Gradle will not be logged. To change this, use 'showGradleLog' desired capability
[Espresso] Repackaging espresso server for: 'nl.rtl.censored'
[Espresso] Creating new manifest: '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/AndroidManifest.xml'
[debug] [ADB] Found the most recent Android platform: {"platform":"android-29","platformPath":"/Users/w.smit/Library/Android/sdk/platforms/android-29"}
[ADB] Using 'aapt2' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/aapt2'
[debug] [ADB] Compiling the manifest using '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/aapt2 link -o /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/AndroidManifest.xml.apk --manifest /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/AndroidManifest.xml --rename-manifest-package io.appium.espressoserver.test --rename-instrumentation-target-package nl.rtl.censored -I /Users/w.smit/Library/Android/sdk/platforms/android-29/android.jar -v'
[debug] [ADB] Compiled the manifest at '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/AndroidManifest.xml.apk'
[debug] [ADB] Inserting manifest '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/AndroidManifest.xml', src: '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk', dst: '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk'
[debug] [ADB] Unzipping '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/AndroidManifest.xml.apk' to '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T'
[debug] [ADB] Unzip successful
[ADB] Using 'aapt' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/aapt'
[debug] [ADB] Moving manifest
[debug] [ADB] Manifest insertion into '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' is completed
[Espresso] Repackaged espresso server ready: '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk'
[debug] [ADB] Checking app cert for /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk"]'
[ADB] Got an error during apksigner execution: Command '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner verify --print-certs /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' exited with code 1
[ADB] apksigner stderr: DOES NOT VERIFY
[ADB] 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?
[ADB] 
[debug] [ADB] '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' is not signed with debug cert
[ADB] Using 'zipalign' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/zipalign'
[debug] [ADB] /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' is already zip-aligned. Doing nothing
[debug] [ADB] Signing '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' with default cert
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["sign","--key","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8","--cert","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk"]'
[debug] [ADB] Uninstalling io.appium.espressoserver.test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.espressoserver.test'
[debug] [ADB] 'io.appium.espressoserver.test' is installed
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am force-stop io.appium.espressoserver.test'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P uninstall io.appium.espressoserver.test'
[debug] [ADB] 'adb uninstall io.appium.espressoserver.test' command output: Success
[ADB] io.appium.espressoserver.test was successfully uninstalled
[Espresso] Uninstalled the obsolete Espresso server package from the device under test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.espressoserver.test'
[debug] [ADB] 'io.appium.espressoserver.test' is not installed
[debug] [ADB] App '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' is not installed
[Espresso] Installing Espresso Test Server apk from the target device (path: '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk')
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
[debug] [ADB] The count of applications in the cache: 10
[ADB] Caching the application at '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' to '/data/local/tmp/appium_cache/8bf80cf9c075c3598884f15e213fc792175b74be.apk'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell mkdir -p /data/local/tmp/appium_cache'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P push /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk /data/local/tmp/appium_cache/8bf80cf9c075c3598884f15e213fc792175b74be.apk'
[ADB] The upload of 'io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' (5.10 MB) took 0.250s
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell rm -f /data/local/tmp/appium_cache/a4e295ed705a1b256e0e87ebe8fdb5925dfcb512.apk'
[debug] [ADB] Deleted 1 expired application cache entries
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell pm install /data/local/tmp/appium_cache/8bf80cf9c075c3598884f15e213fc792175b74be.apk'
[ADB] The installation of 'io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' took 3.467s
[debug] [ADB] Install command stdout: Success
[Espresso] Installed Espresso Test Server apk '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.18.0_nl.rtl.censored.apk' (pkg: 'io.appium.espressoserver.test')
[debug] [Espresso] Performing cleanup of automation leftovers
[debug] [Espresso] No obsolete sessions have been detected (Error: read ECONNRESET)
[Espresso] Starting Espresso Server v1.18.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","RF8M204GZ1P","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/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am force-stop nl.rtl.censored'
[debug] [Logcat] Stopping logcat capture
[Espresso] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy_pre_p_apps'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy_p_apps'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy'
[debug] [ADB] Removing forwarded port socket connection: 8300 
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P forward --remove tcp\:8300'
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1583324923088 (13:28:43 GMT+0100 (Central European Standard Time))
[debug] [W3C] Encountered internal error running command: A new session could not be created. Details: The process did not start within 30000ms (cmd: '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner'). Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] [W3C] Error: The process did not start within 30000ms (cmd: '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner')
[debug] [W3C]     at Timeout._onTimeout (/usr/local/lib/node_modules/appium/node_modules/teen_process/lib/subprocess.js:197:18)
[debug] [W3C]     at listOnTimeout (internal/timers.js:537:17)
[debug] [W3C]     at processTimers (internal/timers.js:481:7)
[HTTP] <-- POST /wd/hub/session 500 51521 ms - 926
[HTTP] 
@KazuCocoa
Copy link
Member

What about with npm i appium@1.17.0-rc.1 https://www.npmjs.com/package/appium/v/1.17.0-rc.1 ?

@wiensmit
Copy link
Author

wiensmit commented Mar 5, 2020

haven't tried the release candidate yet, will try and see what happens

@wiensmit
Copy link
Author

wiensmit commented Mar 6, 2020

Some more info:
I tried the same with appium 1.17.0-rc.1 and got some different logs. however they still seem to boil down to the same problem with the signature of the espresso apk being different than the app.

[Appium] Welcome to Appium v1.17.0-rc.1
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{"appium:iosInstallPause":"8000","appium:udid":"RF8M204GZ1P","appium:wdaStartupRetryInterval":"20000","appium:automationName":"Espresso","appium:xcodesigningid":"iPhone Developer","appium:app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","appium:wdaStartupRetries":"4","appium:deviceName":"Galaxy S10","appium:xcodeorgid":"JB3BDGC96R","appium:maxTypingFrequency":"3000","platformName":"android"}]},"desiredCapabilities":{"deviceName":"Galaxy S10","xcodeorgid":"JB3BDGC96R","udid":"RF8M204GZ1P","automationName":"Espresso","wdaStartupRetries":"4","iosInstallPause":"8000","xcodesigningid":"iPhone Developer","wdaStartupRetryInterval":"20000","platformName":"android","app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","maxTypingFrequency":"3000"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"Galaxy S10","xcodeorgid":"JB3BDGC96R","udid":"RF8M204GZ1P","automationName":"Espresso","wdaStartupRetries":"4","iosInstallPause":"8000","xcodesigningid":"iPhone Developer","wdaStartupRetryInterval":"20000","platformName":"android","app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","maxTypingFrequency":"3000"},null,{"firstMatch":[{"appium:iosInstallPause":"8000","appium:udid":"RF8M204GZ1P","appium:wdaStartupRetryInterval":"20000","appium:automationName":"Espresso","appium:xcodesigningid":"iPhone Developer","appium:app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","appium:wdaStartupRetries":"4","appium:deviceName":"Galaxy S10","appium:xcodeorgid":"JB3BDGC96R","appium:maxTypingFrequency":"3000","platformName":"android"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1583485975723 (10:12:55 GMT+0100 (Central European Standard Time))
[Appium] Appium v1.17.0-rc.1 creating new EspressoDriver (v1.23.2) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "android",
[debug] [BaseDriver]     "appium:iosInstallPause": "8000",
[debug] [BaseDriver]     "appium:udid": "RF8M204GZ1P",
[debug] [BaseDriver]     "appium:wdaStartupRetryInterval": "20000",
[debug] [BaseDriver]     "appium:automationName": "Espresso",
[debug] [BaseDriver]     "appium:xcodesigningid": "iPhone Developer",
[debug] [BaseDriver]     "appium:app": "/Users/w.smit/Documents/censored_appium/apk/censored.apk",
[debug] [BaseDriver]     "appium:wdaStartupRetries": "4",
[debug] [BaseDriver]     "appium:deviceName": "Galaxy S10",
[debug] [BaseDriver]     "appium:xcodeorgid": "JB3BDGC96R",
[debug] [BaseDriver]     "appium:maxTypingFrequency": "3000"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   iosInstallPause
[BaseDriver]   wdaStartupRetryInterval
[BaseDriver]   xcodesigningid
[BaseDriver]   wdaStartupRetries
[BaseDriver]   xcodeorgid
[BaseDriver]   maxTypingFrequency
[BaseDriver] Session created with session id: 8a18b60e-4ba9-4694-a0c2-b973a26374e4
[BaseDriver] Using local app '/Users/w.smit/Documents/censored_appium/apk/censored.apk'
[debug] [Espresso] Checking whether app is actually present
[Espresso] EspressoDriver version: 1.23.2
[ADB] Found 6 'build-tools' folders under '/Users/w.smit/Library/Android/sdk' (newest first):
[ADB]     /Users/w.smit/Library/Android/sdk/build-tools/29.0.2
[ADB]     /Users/w.smit/Library/Android/sdk/build-tools/28.0.3
[ADB]     /Users/w.smit/Library/Android/sdk/build-tools/28.0.2
[ADB]     /Users/w.smit/Library/Android/sdk/build-tools/27.0.3
[ADB]     /Users/w.smit/Library/Android/sdk/build-tools/26.0.2
[ADB]     /Users/w.smit/Library/Android/sdk/build-tools/25.0.3
[ADB] Using 'adb' from '/Users/w.smit/Library/Android/sdk/platform-tools/adb'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] Connected devices: [{"udid":"RF8M204GZ1P","state":"device"}]
[AndroidDriver] Using device: RF8M204GZ1P
[ADB] Using 'adb' from '/Users/w.smit/Library/Android/sdk/platform-tools/adb'
[debug] [ADB] Setting device id to RF8M204GZ1P
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 29
[ADB] Getting device platform version
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 10
[debug] [ADB] Device API level: 29
[Espresso] Relaxing hidden api policy
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy_pre_p_apps 1'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy_p_apps 1'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy 1'
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: 'nl.rtl.censored'
[ADB] Main activity name: 'nl.rtl.censored.ui.onboarding.OnboardingActivity'
[debug] [AndroidDriver] Parsed package and activity are: nl.rtl.censored/nl.rtl.censored.ui.onboarding.OnboardingActivity
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P wait-for-device'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.settings'
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.1.0' >= '3.1.0')
[debug] [ADB] There is no need to install/upgrade '/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell 'pgrep --help; echo $?''
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell pgrep -f io\\.appium\\.settings'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell appops set io.appium.settings android\:mock_location allow'
[debug] [Logcat] Starting logcat capture
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global animator_duration_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global transition_animation_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global window_animation_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus disable'
[debug] [Espresso] Forwarding Espresso Server port 6791 to 8300
[debug] [ADB] Forwarding system: 8300 to device: 6791
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P forward tcp\:8300 tcp\:6791'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Checking app cert for /Users/w.smit/Documents/censored_appium/apk/censored.apk
[ADB] Using 'apksigner' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner'
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/Users/w.smit/Documents/censored_appium/apk/censored.apk"]'
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB] 
[debug] [ADB] '/Users/w.smit/Documents/censored_appium/apk/censored.apk' is already signed.
[debug] [ADB] Getting install status for nl.rtl.censored
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package nl.rtl.censored'
[debug] [ADB] 'nl.rtl.censored' is installed
[debug] [ADB] Getting package info for 'nl.rtl.censored'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package nl.rtl.censored'
[debug] [ADB] The version code of the installed 'nl.rtl.censored' is greater than the application version code (2605 > 2517)
[debug] [ADB] There is no need to downgrade 'nl.rtl.censored'
[AndroidDriver] Performing fast reset on 'nl.rtl.censored'
[debug] [ADB] Getting install status for nl.rtl.censored
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package nl.rtl.censored'
[debug] [ADB] 'nl.rtl.censored' is installed
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am force-stop nl.rtl.censored'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell pm clear nl.rtl.censored'
[debug] [AndroidDriver] Performed fast reset on the installed 'nl.rtl.censored' application (stop and clear)
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell ls /data/local/tmp/espresso.apppackage'
[debug] [Espresso] The previous target application package is unknown
[Espresso] Forcing Espresso server rebuild because of changed application package
[debug] [Espresso] Deleting the obsolete Espresso server package '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk'
[Espresso] Building espresso server in '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P'
[debug] [Espresso] The build folder root could be customized by changing the 'tmpDir' capability
[debug] [Espresso] Copying espresso server template from ('/usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/espresso-server' to '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P')
[debug] [Support] Traversed 49 directories and 250 files in 234ms
[debug] [Espresso] Bulding espresso server
[debug] [Espresso] Beginning build with command './gradlew -PappiumTargetPackage=nl.rtl.censored assembleAndroidTest' in directory '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P'
[debug] [Espresso] Output from Gradle will not be logged. To change this, use 'showGradleLog' desired capability
[debug] [Espresso] Copying built apk from '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk' to '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk'
[debug] [ADB] Checking app cert for /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk"]'
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] [ADB] Signer #1 certificate SHA-256 digest: f7579a29a71e1c5526bc3e47028153cac4c04221c757fdca7965d25df0332c18
[debug] [ADB] Signer #1 certificate SHA-1 digest: 13fbc3eeae43c675bb65b69d741f3d349d7f6644
[debug] [ADB] Signer #1 certificate MD5 digest: 751fdbb89a382e4b990fa6824b6ce632
[debug] [ADB] 
[debug] [ADB] '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is signed with non-default certificate
[ADB] Using 'zipalign' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/zipalign'
[debug] [ADB] /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is already zip-aligned. Doing nothing
[debug] [ADB] Signing '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' with default cert
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["sign","--key","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8","--cert","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk"]'
[debug] [ADB] Uninstalling io.appium.espressoserver.test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.espressoserver.test'
[debug] [ADB] 'io.appium.espressoserver.test' is installed
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am force-stop io.appium.espressoserver.test'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P uninstall io.appium.espressoserver.test'
[debug] [ADB] 'adb uninstall io.appium.espressoserver.test' command output: Success
[ADB] io.appium.espressoserver.test was successfully uninstalled
[Espresso] Uninstalled the obsolete Espresso server package from the device under test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.espressoserver.test'
[debug] [ADB] 'io.appium.espressoserver.test' is not installed
[debug] [ADB] App '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is not installed
[Espresso] Installing Espresso Test Server apk from the target device (path: '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk')
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
[debug] [ADB] The count of applications in the cache: 10
[ADB] Caching the application at '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' to '/data/local/tmp/appium_cache/f8c070b04296691b970c1e66ac6b933d09d43df3.apk'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell mkdir -p /data/local/tmp/appium_cache'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P push /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk /data/local/tmp/appium_cache/f8c070b04296691b970c1e66ac6b933d09d43df3.apk'
[ADB] The upload of 'io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' (4.65 MB) took 236ms
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell rm -f /data/local/tmp/appium_cache/752c18d490a7028a99f15f63af34fb8c1dfa5567.apk'
[debug] [ADB] Deleted 1 expired application cache entries
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell pm install /data/local/tmp/appium_cache/f8c070b04296691b970c1e66ac6b933d09d43df3.apk'
[ADB] The installation of 'io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' took 2649ms
[debug] [ADB] Install command stdout: Success
[Espresso] Installed Espresso Test Server apk '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' (pkg: 'io.appium.espressoserver.test')
[debug] [Espresso] Performing cleanup of automation leftovers
[debug] [Espresso] No obsolete sessions have been detected (Error: read ECONNRESET)
[Espresso] Starting Espresso Server v1.23.2 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","RF8M204GZ1P","shell","am","instrument","-w","-e","debug","false","io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner"]
[debug] [Espresso] [Instrumentation] [STDERR] java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=20583, uid=20583 not allowed because package io.appium.espressoserver.test does not have a signature matching the target nl.rtl.censored
[debug] [Espresso] [Instrumentation] [STDERR] 	at android.os.Parcel.createException(Parcel.java:2088)
[debug] [Espresso] [Instrumentation] [STDERR] 	at android.os.Parcel.readException(Parcel.java:2056)
[debug] [Espresso] [Instrumentation] [STDERR] 	at android.os.Parcel.readException(Parcel.java:2004)
[debug] [Espresso] [Instrumentation] [STDERR] 	at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:6144)
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.commands.am.Instrument.run(Instrument.java:512)
[debug] [Espresso] Deleting espresso session
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus enable'
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.commands.am.Am.runInstrument(Am.java:196)
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.commands.am.Am.onRun(Am.java:80)
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.internal.os.BaseCommand.run(BaseCommand.java:56)
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.commands.am.Am.main(Am.java:50)
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:339)
[debug] [Espresso] [Instrumentation] [STDERR] Caused by: android.os.RemoteException: Remote stack trace:
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.server.am.ActivityManagerService.startInstrumentation(ActivityManagerService.java:17939)
[debug] [Espresso] [Instrumentation] [STDERR] 	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2681)
[debug] [Espresso] [Instrumentation] [STDERR] 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3293)
[debug] [Espresso] [Instrumentation] [STDERR] 	at android.os.Binder.execTransactInternal(Binder.java:1021)
[debug] [Espresso] [Instrumentation] [STDERR] 	at android.os.Binder.execTransact(Binder.java:994)
[debug] [Espresso] [Instrumentation] [STDERR]
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=20583, uid=20583 not allowed because package io.appium.espressoserver.test does not have a signature matching the target nl.rtl.censored
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_STATUS: id=ActivityManagerService
[debug] [Espresso] [Instrumentation] [STDOUT] INSTRUMENTATION_STATUS_CODE: -1
[Espresso] Instrumentation process exited with code 1 from signal null
[Espresso] Instrumentation process died with code 1 and signal null
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am force-stop nl.rtl.censored'
[debug] [Logcat] Stopping logcat capture
[Espresso] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy_pre_p_apps'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy_p_apps'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy'
[debug] [ADB] Removing forwarded port socket connection: 8300 
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P forward --remove tcp\:8300'
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1583485999790 (10:13:19 GMT+0100 (Central European Standard Time))
[debug] [W3C] Encountered internal error running command: A new session could not be created. Details: java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=20583, uid=20583 not allowed because package io.appium.espressoserver.test does not have a signature matching the target nl.rtl.censored
[debug] [W3C] 	at android.os.Parcel.createException(Parcel.java:2088)
[debug] [W3C] 	at android.os.Parcel.readException(Parcel.java:2056)
[debug] [W3C] 	at android.os.Parcel.readException(Parcel.java:2004)
[debug] [W3C] 	at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:6144)
[debug] [W3C] 	at com.android.commands.am.Instrument.run(Instrument.java:512). Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] [W3C] Error: java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid=20583, uid=20583 not allowed because package io.appium.espressoserver.test does not have a signature matching the target nl.rtl.censored
[debug] [W3C] 	at android.os.Parcel.createException(Parcel.java:2088)
[debug] [W3C] 	at android.os.Parcel.readException(Parcel.java:2056)
[debug] [W3C] 	at android.os.Parcel.readException(Parcel.java:2004)
[debug] [W3C] 	at android.app.IActivityManager$Stub$Proxy.startInstrumentation(IActivityManager.java:6144)
[debug] [W3C] 	at com.android.commands.am.Instrument.run(Instrument.java:512)
[debug] [W3C]     at startDetector (/usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/lib/espresso-runner.js:239:15)
[debug] [W3C]     at handleOutput (/usr/local/lib/node_modules/appium/node_modules/teen_process/lib/subprocess.js:106:32)
[debug] [W3C]     at Socket.<anonymous> (/usr/local/lib/node_modules/appium/node_modules/teen_process/lib/subprocess.js:159:48)
[debug] [W3C]     at Socket.emit (events.js:316:20)
[debug] [W3C]     at addChunk (_stream_readable.js:297:12)
[debug] [W3C]     at readableAddChunk (_stream_readable.js:269:11)
[debug] [W3C]     at Socket.Readable.push (_stream_readable.js:214:10)
[debug] [W3C]     at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
[debug] [W3C] Destroying socket connection
[HTTP] <-- POST /wd/hub/session 500 24074 ms - 2129
[HTTP] 

@KazuCocoa
Copy link
Member

[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Checking app cert for /Users/w.smit/Documents/censored_appium/apk/censored.apk
[ADB] Using 'apksigner' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner'
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/Users/w.smit/Documents/censored_appium/apk/censored.apk"]'
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB] 
[debug] [ADB] '/Users/w.smit/Documents/censored_appium/apk/censored.apk' is already signed.
[debug] [ADB] Getting install status for nl.rtl.censored
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk"]'
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] [ADB] Signer #1 certificate SHA-256 digest: f7579a29a71e1c5526bc3e47028153cac4c04221c757fdca7965d25df0332c18
[debug] [ADB] Signer #1 certificate SHA-1 digest: 13fbc3eeae43c675bb65b69d741f3d349d7f6644
[debug] [ADB] Signer #1 certificate MD5 digest: 751fdbb89a382e4b990fa6824b6ce632
[debug] [ADB] 
[debug] [ADB] '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is signed with non-default certificate
[ADB] Using 'zipalign' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/zipalign'
[debug] [ADB] /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is already zip-aligned. Doing nothing
[debug] [ADB] Signing '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' with default cert
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["sign","--key","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8","--cert","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk"]'
[debug] [ADB] Uninstalling io.appium.espressoserver.test

What is current cert of /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk? Hm, maybe it was signed with appium's cert...

@wiensmit
Copy link
Author

wiensmit commented Mar 10, 2020

Hi, i checked the certificate of both apk's, it seems they are actually the same. Kind of weird that it gives the error that they are not.

keytool -printcert -jarfile censored.apk
Signer #1:

Signature:

Owner: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
Issuer: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
Serial number: 936eacbe07f201df
Valid from: Fri Feb 29 02:33:46 CET 2008 until: Tue Jul 17 03:33:46 CEST 2035
Certificate fingerprints:
	 SHA1: 61:ED:37:7E:85:D3:86:A8:DF:EE:6B:86:4B:D8:5B:0B:FA:A5:AF:81
	 SHA256: A4:0D:A8:0A:59:D1:70:CA:A9:50:CF:15:C1:8C:45:4D:47:A3:9B:26:98:9D:8B:64:0E:CD:74:5B:A7:1B:F5:DC
Signature algorithm name: SHA1withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions: 

#1: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 48 59 00 56 3D 27 2C 46   AE 11 86 05 A4 74 19 AC  HY.V=',F.....t..
0010: 09 CA 8C 11                                        ....
]
[EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US]
SerialNumber: [    936eacbe 07f201df]
]

#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
  CA:true
  PathLen:2147483647
]

#3: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 48 59 00 56 3D 27 2C 46   AE 11 86 05 A4 74 19 AC  HY.V=',F.....t..
0010: 09 CA 8C 11                                        ....
]
]

keytool -printcert -jarfile io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk 
Signer #1:

Signature:

Owner: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
Issuer: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
Serial number: 936eacbe07f201df
Valid from: Fri Feb 29 02:33:46 CET 2008 until: Tue Jul 17 03:33:46 CEST 2035
Certificate fingerprints:
	 SHA1: 61:ED:37:7E:85:D3:86:A8:DF:EE:6B:86:4B:D8:5B:0B:FA:A5:AF:81
	 SHA256: A4:0D:A8:0A:59:D1:70:CA:A9:50:CF:15:C1:8C:45:4D:47:A3:9B:26:98:9D:8B:64:0E:CD:74:5B:A7:1B:F5:DC
Signature algorithm name: SHA1withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions: 

#1: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 48 59 00 56 3D 27 2C 46   AE 11 86 05 A4 74 19 AC  HY.V=',F.....t..
0010: 09 CA 8C 11                                        ....
]
[EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US]
SerialNumber: [    936eacbe 07f201df]
]

#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
  CA:true
  PathLen:2147483647
]

#3: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 48 59 00 56 3D 27 2C 46   AE 11 86 05 A4 74 19 AC  HY.V=',F.....t..
0010: 09 CA 8C 11                                        ....
]
]

@KazuCocoa
Copy link
Member

What about setting different build tools version by buildToolsVersion
https://appium.io/docs/en/writing-running-appium/caps/ ?
The check/sign process depends on apksigner in build tools.

@wiensmit
Copy link
Author

I have tried buildtools versions: 26.0.2, 27.0.3, 28.0.3, 29.0.2 and 30.0.0-rc1
But all give the same kind of error.

@wiensmit
Copy link
Author

wiensmit commented Mar 12, 2020

Alright, so i removed all the espresso/appium files in the _y folder structure and replaced the app apk with a newly build one. This time the signing seems to go alright however it looks like the espressoserver crashes:

[HTTP] {"capabilities":{"firstMatch":[{"appium:iosInstallPause":"8000","appium:udid":"RF8M204GZ1P","appium:noReset":"true","appium:xcodeorgid":"JB3BDGC96R","appium:wdaStartupRetryInterval":"20000","appium:automationName":"Espresso","appium:xcodesigningid":"iPhone Developer","appium:app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","appium:wdaStartupRetries":"4","appium:deviceName":"Galaxy S10","appium:buildToolsVersion":"29.0.2","appium:platformVersion":"10","appium:maxTypingFrequency":"3000","platformName":"android"}]},"desiredCapabilities":{"deviceName":"Galaxy S10","xcodeorgid":"JB3BDGC96R","udid":"RF8M204GZ1P","automationName":"Espresso","noReset":"true","wdaStartupRetries":"4","iosInstallPause":"8000","xcodesigningid":"iPhone Developer","buildToolsVersion":"29.0.2","platformVersion":"10","wdaStartupRetryInterval":"20000","platformName":"android","app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","maxTypingFrequency":"3000"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"Galaxy S10","xcodeorgid":"JB3BDGC96R","udid":"RF8M204GZ1P","automationName":"Espresso","noReset":"true","wdaStartupRetries":"4","iosInstallPause":"8000","xcodesigningid":"iPhone Developer","buildToolsVersion":"29.0.2","platformVersion":"10","wdaStartupRetryInterval":"20000","platformName":"android","app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","maxTypingFrequency":"3000"},null,{"firstMatch":[{"appium:iosInstallPause":"8000","appium:udid":"RF8M204GZ1P","appium:noReset":"true","appium:xcodeorgid":"JB3BDGC96R","appium:wdaStartupRetryInterval":"20000","appium:automationName":"Espresso","appium:xcodesigningid":"iPhone Developer","appium:app":"/Users/w.smit/Documents/censored_appium/apk/censored.apk","appium:wdaStartupRetries":"4","appium:deviceName":"Galaxy S10","appium:buildToolsVersion":"29.0.2","appium:platformVersion":"10","appium:maxTypingFrequency":"3000","platformName":"android"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1584025000039 (15:56:40 GMT+0100 (Central European Standard Time))
[Appium] Appium v1.17.0-rc.1 creating new EspressoDriver (v1.23.2) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "android",
[debug] [BaseDriver]     "appium:iosInstallPause": "8000",
[debug] [BaseDriver]     "appium:udid": "RF8M204GZ1P",
[debug] [BaseDriver]     "appium:noReset": "true",
[debug] [BaseDriver]     "appium:xcodeorgid": "JB3BDGC96R",
[debug] [BaseDriver]     "appium:wdaStartupRetryInterval": "20000",
[debug] [BaseDriver]     "appium:automationName": "Espresso",
[debug] [BaseDriver]     "appium:xcodesigningid": "iPhone Developer",
[debug] [BaseDriver]     "appium:app": "/Users/w.smit/Documents/censored_appium/apk/censored.apk",
[debug] [BaseDriver]     "appium:wdaStartupRetries": "4",
[debug] [BaseDriver]     "appium:deviceName": "Galaxy S10",
[debug] [BaseDriver]     "appium:buildToolsVersion": "29.0.2",
[debug] [BaseDriver]     "appium:platformVersion": "10",
[debug] [BaseDriver]     "appium:maxTypingFrequency": "3000"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   iosInstallPause
[BaseDriver]   xcodeorgid
[BaseDriver]   wdaStartupRetryInterval
[BaseDriver]   xcodesigningid
[BaseDriver]   wdaStartupRetries
[BaseDriver]   maxTypingFrequency
[BaseDriver] Session created with session id: 135907b8-52b3-4c96-86df-cbe7a251b6a6
[BaseDriver] Using local app '/Users/w.smit/Documents/censored_appium/apk/censored.apk'
[debug] [Espresso] Checking whether app is actually present
[Espresso] EspressoDriver version: 1.23.2
[ADB] Using build tools at '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2'
[ADB] Using 'adb' from '/Users/w.smit/Library/Android/sdk/platform-tools/adb'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] Connected devices: [{"udid":"RF8M204GZ1P","state":"device"},{"udid":"10.52.8.249:5555","state":"device"}]
[AndroidDriver] Using device: RF8M204GZ1P
[ADB] Using build tools at '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2'
[ADB] Using 'adb' from '/Users/w.smit/Library/Android/sdk/platform-tools/adb'
[debug] [ADB] Setting device id to RF8M204GZ1P
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 29
[ADB] Getting device platform version
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 10
[debug] [ADB] Device API level: 29
[Espresso] Relaxing hidden api policy
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy_pre_p_apps 1'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy_p_apps 1'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings put global hidden_api_policy 1'
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: 'nl.rtl.censored'
[ADB] Main activity name: 'nl.rtl.censored.ui.onboarding.OnboardingActivity'
[debug] [AndroidDriver] Parsed package and activity are: nl.rtl.censored/nl.rtl.censored.ui.onboarding.OnboardingActivity
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P wait-for-device'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.settings'
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.1.0' >= '3.1.0')
[debug] [ADB] There is no need to install/upgrade '/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell 'pgrep --help; echo $?''
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell pgrep -f io\\.appium\\.settings'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell appops set io.appium.settings android\:mock_location allow'
[debug] [Logcat] Starting logcat capture
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global animator_duration_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global transition_animation_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings get global window_animation_scale'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus disable'
[debug] [Espresso] Forwarding Espresso Server port 6791 to 8300
[debug] [ADB] Forwarding system: 8300 to device: 6791
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P forward tcp\:8300 tcp\:6791'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Checking app cert for /Users/w.smit/Documents/censored_appium/apk/censored.apk
[ADB] Using build tools at '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2'
[ADB] Using 'apksigner' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner'
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/Users/w.smit/Documents/censored_appium/apk/censored.apk"]'
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB] 
[debug] [ADB] '/Users/w.smit/Documents/censored_appium/apk/censored.apk' is already signed.
[debug] [ADB] Getting install status for nl.rtl.censored
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package nl.rtl.censored'
[debug] [ADB] 'nl.rtl.censored' is installed
[debug] [ADB] Getting package info for 'nl.rtl.censored'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package nl.rtl.censored'
[debug] [ADB] The version name of the installed 'nl.rtl.censored' is greater or equal to the application version name ('4.1.3' >= '4.1.3')
[debug] [ADB] There is no need to install/upgrade '/Users/w.smit/Documents/censored_appium/apk/censored.apk'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell ls /data/local/tmp/espresso.apppackage'
[debug] [Espresso] The previous target application package is unknown
[Espresso] Forcing Espresso server rebuild because of changed application package
[debug] [Espresso] Deleting the obsolete Espresso server package '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk'
[Espresso] Building espresso server in '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P'
[debug] [Espresso] The build folder root could be customized by changing the 'tmpDir' capability
[debug] [Espresso] Copying espresso server template from ('/usr/local/lib/node_modules/appium/node_modules/appium-espresso-driver/espresso-server' to '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P')
[debug] [Support] Traversed 49 directories and 250 files in 153ms
[debug] [Espresso] Bulding espresso server
[debug] [Espresso] Beginning build with command './gradlew -PappiumTargetPackage=nl.rtl.censored assembleAndroidTest' in directory '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P'
[debug] [Espresso] Output from Gradle will not be logged. To change this, use 'showGradleLog' desired capability
[debug] [Espresso] Copying built apk from '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/espresso-server-RF8M204GZ1P/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk' to '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk'
[debug] [ADB] Checking app cert for /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["verify","--print-certs","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk"]'
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] [ADB] Signer #1 certificate SHA-256 digest: f7579a29a71e1c5526bc3e47028153cac4c04221c757fdca7965d25df0332c18
[debug] [ADB] Signer #1 certificate SHA-1 digest: 13fbc3eeae43c675bb65b69d741f3d349d7f6644
[debug] [ADB] Signer #1 certificate MD5 digest: 751fdbb89a382e4b990fa6824b6ce632
[debug] [ADB] 
[debug] [ADB] '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is signed with non-default certificate
[ADB] Using build tools at '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2'
[ADB] Using 'zipalign' from '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/zipalign'
[debug] [ADB] /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is already zip-aligned. Doing nothing
[debug] [ADB] Signing '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' with default cert
[debug] [ADB] Starting '/Users/w.smit/Library/Android/sdk/build-tools/29.0.2/apksigner' with args '["sign","--key","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8","--cert","/usr/local/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem","/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk"]'
[debug] [ADB] Uninstalling io.appium.espressoserver.test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.espressoserver.test'
[debug] [ADB] 'io.appium.espressoserver.test' is installed
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am force-stop io.appium.espressoserver.test'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P uninstall io.appium.espressoserver.test'
[debug] [ADB] 'adb uninstall io.appium.espressoserver.test' command output: Success
[ADB] io.appium.espressoserver.test was successfully uninstalled
[Espresso] Uninstalled the obsolete Espresso server package from the device under test
[debug] [ADB] Getting install status for io.appium.espressoserver.test
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell dumpsys package io.appium.espressoserver.test'
[debug] [ADB] 'io.appium.espressoserver.test' is not installed
[debug] [ADB] App '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' is not installed
[Espresso] Installing Espresso Test Server apk from the target device (path: '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk')
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
[debug] [ADB] The count of applications in the cache: 10
[ADB] Caching the application at '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' to '/data/local/tmp/appium_cache/1334743da1fe7265fa3d987c8952c8c1e5890842.apk'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell mkdir -p /data/local/tmp/appium_cache'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P push /var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk /data/local/tmp/appium_cache/1334743da1fe7265fa3d987c8952c8c1e5890842.apk'
[ADB] The upload of 'io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' (4.65 MB) took 233ms
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell rm -f /data/local/tmp/appium_cache/f4bef0502a9b8618fe25fcd590f0bd53704f5faf.apk'
[debug] [ADB] Deleted 1 expired application cache entries
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell pm install /data/local/tmp/appium_cache/1334743da1fe7265fa3d987c8952c8c1e5890842.apk'
[ADB] The installation of 'io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.apk' took 2789ms
[debug] [ADB] Install command stdout: Success
[Espresso] Installed Espresso Test Server apk '/var/folders/_y/qpybh9cj7h727226wyhvc_kr0000gp/T/io.appium.espressoserver.test_1.23.2_nl.rtl.censored_RF8M204GZ1P.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.23.2 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","RF8M204GZ1P","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/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus enable'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am force-stop nl.rtl.censored'
[debug] [Logcat] Stopping logcat capture
[Espresso] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy_pre_p_apps'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy_p_apps'
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell settings delete global hidden_api_policy'
[debug] [ADB] Removing forwarded port socket connection: 8300 
[debug] [ADB] Running '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P forward --remove tcp\:8300'
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1584025050378 (15:57:30 GMT+0100 (Central European Standard Time))
[debug] [W3C] Encountered internal error running command: A new session could not be created. Details: The process did not start within 30000ms (cmd: '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner'). Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] [W3C] Error: The process did not start within 30000ms (cmd: '/Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner')
[debug] [W3C]     at Timeout._onTimeout (/usr/local/lib/node_modules/appium/node_modules/teen_process/lib/subprocess.js:197:18)
[debug] [W3C]     at listOnTimeout (internal/timers.js:549:17)
[debug] [W3C]     at processTimers (internal/timers.js:492:7)
[debug] [W3C] Destroying socket connection
[HTTP] <-- POST /wd/hub/session 500 50341 ms - 926

@KazuCocoa
Copy link
Member

What happens after /Users/w.smit/Library/Android/sdk/platform-tools/adb -P 5037 -s RF8M204GZ1P shell am instrument -w -e debug false io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner call directly?

@wiensmit
Copy link
Author

The same as indirectly, is there a some log for additional errors?

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

@KazuCocoa
Copy link
Member

What about the logcat?
I assume something error messages were there.

@wiensmit
Copy link
Author

wiensmit commented Mar 18, 2020

  
2020-03-18 11:13:01.449 3196-3196/? W/ActivityThread: Package uses different ABI(s) than its instrumentation: package[nl.rtl.censored]: arm64-v8a, null instrumentation[io.appium.espressoserver.test]: null, null
2020-03-18 11:13:01.623 3196-3196/? W/l.rtl.censored: ClassLoaderContext classpath size mismatch. expected=0, found=3 (PCL[] | PCL[/system/framework/android.test.runner.jar*3312018701:/system/framework/android.test.mock.jar*494539449:/data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk*2991733234])
2020-03-18 11:13:01.629 3196-3196/? W/l.rtl.censored: Found duplicated class when checking oat files: 'Landroid/support/v4/graphics/drawable/IconCompatParcelizer;' in /data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/base.apk and /data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk
2020-03-18 11:13:02.030 3196-3196/? W/l.rtl.censored: ClassLoaderContext classpath size mismatch. expected=0, found=3 (PCL[] | PCL[/system/framework/android.test.runner.jar*3312018701:/system/framework/android.test.mock.jar*494539449:/data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk*2991733234];PCL[/system/framework/android.test.runner.jar*3312018701:/system/framework/android.test.mock.jar*494539449:/data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk*2991733234:/data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/base.apk*189238658:/data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/base.apk!classes2.dex*1579248714])
2020-03-18 11:13:02.365 3196-3196/? I/MonitoringInstr: Setting context classloader to 'dalvik.system.PathClassLoader[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-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk", zip file "/data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/base.apk"],nativeLibraryDirectories=[/data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/lib/arm64, /data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/lib/arm64, /data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk!/lib/arm64-v8a, /data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/base.apk!/lib/arm64-v8a, /system/lib64]]]', Original: 'dalvik.system.PathClassLoader[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-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk", zip file "/data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/base.apk"],nativeLibraryDirectories=[/data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/lib/arm64, /data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/lib/arm64, /data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk!/lib/arm64-v8a, /data/app/nl.rtl.censored-5tWYKWkY_RA01U2CUk_luQ==/base.apk!/lib/arm64-v8a, /system/lib64]]]'


  --------- beginning of crash
2020-03-18 11:13:02.668 3196-3196/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: nl.rtl.censored, PID: 3196
    java.lang.NoSuchFieldError: No field j of type Lcom/google/gson/internal/Excluder; in class Lcom/google/gson/internal/Excluder; or its superclasses (declaration of 'com.google.gson.internal.Excluder' appears in /data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk)
        at g.c.d.e.<init>(SourceFile:1)
        at n.a.b.m.a.c(SourceFile:1)
        at n.a.b.m.g.b(SourceFile:1)
        at n.a.b.m.g.get(SourceFile:2)
        at n.a.b.m.g.get(SourceFile:1)
        at h.c.a.get(SourceFile:6)
        at n.a.b.m.l.get(SourceFile:2)
        at n.a.b.m.l.get(SourceFile:1)
        at h.c.a.get(SourceFile:6)
        at n.a.b.l.c.f(SourceFile:1)
        at nl.rtl.censored.components.t.a.<init>(SourceFile:4)
        at nl.rtl.censored.components.t.b.a(SourceFile:2)
        at nl.rtl.censored.components.t.b.get(SourceFile:2)
        at nl.rtl.censored.components.t.b.get(SourceFile:1)
        at h.c.a.get(SourceFile:6)
        at nl.rtl.censored.components.c.b(SourceFile:60)
        at nl.rtl.censored.components.c.a(SourceFile:54)
        at nl.rtl.censored.AppLifeCycleListener.<init>(SourceFile:2)
        at nl.rtl.censored.VLApplication.onCreate(SourceFile:13)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
        at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:419)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6841)
        at android.app.ActivityThread.access$1400(ActivityThread.java:267)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1981)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:7762)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
2020-03-18 11:13:02.674 3196-3196/? E/InstrumentationResultPrinter: Failed to mark test No Tests as finished after process crash
2020-03-18 11:13:02.674 3196-3196/? E/MonitoringInstr: Exception encountered by: Thread[main,5,main]. Dumping thread state to outputs and pining for the fjords.
    java.lang.NoSuchFieldError: No field j of type Lcom/google/gson/internal/Excluder; in class Lcom/google/gson/internal/Excluder; or its superclasses (declaration of 'com.google.gson.internal.Excluder' appears in /data/app/io.appium.espressoserver.test-Ujofx9d7Fd8Hq8Fp9D9z9Q==/base.apk)
        at g.c.d.e.<init>(SourceFile:1)
        at n.a.b.m.a.c(SourceFile:1)
        at n.a.b.m.g.b(SourceFile:1)
        at n.a.b.m.g.get(SourceFile:2)
        at n.a.b.m.g.get(SourceFile:1)
        at h.c.a.get(SourceFile:6)
        at n.a.b.m.l.get(SourceFile:2)
        at n.a.b.m.l.get(SourceFile:1)
        at h.c.a.get(SourceFile:6)
        at n.a.b.l.c.f(SourceFile:1)
        at nl.rtl.censored.components.t.a.<init>(SourceFile:4)
        at nl.rtl.censored.components.t.b.a(SourceFile:2)
        at nl.rtl.censored.components.t.b.get(SourceFile:2)
        at nl.rtl.censored.components.t.b.get(SourceFile:1)
        at h.c.a.get(SourceFile:6)
        at nl.rtl.censored.components.c.b(SourceFile:60)
        at nl.rtl.censored.components.c.a(SourceFile:54)
        at nl.rtl.censored.AppLifeCycleListener.<init>(SourceFile:2)
        at nl.rtl.censored.VLApplication.onCreate(SourceFile:13)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
        at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:419)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6841)
        at android.app.ActivityThread.access$1400(ActivityThread.java:267)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1981)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:7762)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
2020-03-18 11:13:02.677 3308-3308/? E/rca:videoplaye: Not starting debugger since process cannot load the jdwp agent.
2020-03-18 11:13:02.678 3196-3196/? E/THREAD_STATE:   Thread[pool-9-thread-1,5,main]
        sun.misc.Unsafe.park(Native Method)
        java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
        java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
        java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        java.lang.Thread.run(Thread.java:919)
    
      Thread[Queue,10,main]
        sun.misc.Unsafe.park(Native Method)
        java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
        java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
        java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:548)
        j.a.a.a.n.c.d.b(SourceFile:4)
        j.a.a.a.n.c.d.a(SourceFile:6)
        j.a.a.a.n.c.d.take(SourceFile:2)
        j.a.a.a.n.c.d.take(SourceFile:1)
        java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        java.lang.Thread.run(Thread.java:919)
    
      Thread[Binder:3196_3,5,main]
    
      Thread[dtxAgentDatabaseWriteQueue,5,main]
        java.lang.Thread.sleep(Native Method)
        java.lang.Thread.sleep(Thread.java:440)
        java.lang.Thread.sleep(Thread.java:356)
        g.b.a.a.g0.b.run(SourceFile:4)
    
      Thread[FinalizerDaemon,5,system]
        java.lang.Object.wait(Native Method)
        java.lang.Object.wait(Object.java:442)
        java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190)
        java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211)
        java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:271)
        java.lang.Daemons$Daemon.run(Daemons.java:137)
        java.lang.Thread.run(Thread.java:919)
    
      Thread[AsyncTask #2,5,main]
        sun.misc.Unsafe.park(Native Method)
        java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
        java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2109)
        java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
        com.google.android.gms.common.a.a(SourceFile:4)
        com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source:4)
        com.google.android.gms.ads.identifier.AdvertisingIdClient.zza(Unknown Source:27)
        com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source:47)
        java.lang.reflect.Method.invoke(Native Method)
        com.facebook.internal.w.a(SourceFile:176)
        com.facebook.internal.a.b(SourceFile:3)
        com.facebook.internal.a.a(SourceFile:1)
        com.facebook.internal.a.d(SourceFile:1)
        com.facebook.n.a(SourceFile:32)
        com.facebook.n$e.run(SourceFile:1)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        java.lang.Thread.run(Thread.java:919)
    
      Thread[pool-16-thread-1,5,main]
        sun.misc.Unsafe.park(Native Method)
        java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
        java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
        java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        java.lang.Thread.run(Thread.java:919)
    
      Thread[firebase-iid-executor,5,main]
        sun.misc.Unsafe.park(Native Method)
        java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
        java.util.concurrent.
2020-03-18 11:13:02.679 3196-3196/? E/MonitoringInstr: Dying now...

@KazuCocoa
Copy link
Member

Similar to #232 ?
Appium espresso server uses GSON. proguard may also affect it if your app did something to gson, I guess...

@wiensmit
Copy link
Author

I added a rule in addition to the other proguard rules in the readme

    -keep class com.google.gson.** { *; }

This seems to solve the issue with gson, however, i now get an error similar to #449
I have tried a lot of the supposed 'fixes' in that issue, however none of them seem to be working..

2020-03-20 10:28:23.052 18981-18981/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: nl.rtl.censored, PID: 18981
    java.lang.RuntimeException: Unable to start activity ComponentInfo{nl.rtl.censored/nl.rtl.censored.ui.onboarding.OnboardingActivity}: android.content.res.Resources$NotFoundException: Drawable nl.rtl.censored:dimen/button_long_height with resource ID #0x7f070059
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3447)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3594)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2146)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:7762)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
     Caused by: android.content.res.Resources$NotFoundException: Drawable nl.rtl.censored:dimen/button_long_height with resource ID #0x7f070059
     Caused by: android.content.res.Resources$NotFoundException: Resource "nl.rtl.censored:dimen/button_long_height" (7f070059) is not a Drawable (color or path): TypedValue{t=0x5/d=0x3001 a=7 r=0x7f070059}
        at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:838)
        at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:683)
        at android.content.res.Resources.getDrawableForDensity(Resources.java:921)
        at android.content.res.Resources.getDrawable(Resources.java:860)
        at android.content.Context.getDrawable(Context.java:689)
        at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:463)
        at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:203)
        at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
        at androidx.appcompat.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:753)
        at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:196)
        at androidx.appcompat.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:86)
        at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:260)
        at androidx.appcompat.app.AppCompatDelegate.create(AppCompatDelegate.java:182)
        at androidx.appcompat.app.AppCompatActivity.getDelegate(AppCompatActivity.java:520)
        at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
        at nl.rtl.censored.ui.activities.z.onCreate(SourceFile:1)
        at nl.rtl.censored.ui.activities.d0.onCreate(SourceFile:2)
        at nl.rtl.censored.ui.onboarding.OnboardingActivity.onCreate(SourceFile:1)
        at android.app.Activity.performCreate(Activity.java:7981)
        at android.app.Activity.performCreate(Activity.java:7970)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
        at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:702)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3594)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2146)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:7762)


@wiensmit
Copy link
Author

@KazuCocoa any idea how this can be solved?

@KazuCocoa
Copy link
Member

KazuCocoa commented Apr 5, 2020

No, unfortunately. It strongly depends on your environment because of Espresso framework.
AFAIK, you should coordinate your build environment like #449 because of Espresso's limitation.

You can also customise Appium's Espresso server build environment as https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md#espresso-server-build-configuration-json

Close this once since current your issue is similar to 449

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