An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate

Hello everyone!

I’ve been trying to run a simple application on an AVD but I always have the following error. Is this related to the Desired Capabilities?

[PROBLEM]

An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate. Original error Command ‘/usr/lib/jvm/jdk1.8.0_221/bin/java -jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-adb/jars/sign.jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-driver/uiautomator2/appium-uiautomator2-server-v0.3.0.apk --override’ exited with code 1

[LOG APPIUM]

[Appium] Welcome to Appium v1.7.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“automationName”:“uiautomator2”,“platformName”:“Android”,“deviceName”:“emulator-5554”},“requiredCapabilities”:{},“capabilities”:{“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“automationName”:“uiautomator2”,“platformName”:“Android”,“deviceName”:“emulator-5554”},“requiredCapabilities”:{},“alwaysMatch”:{“platformName”:“Android”},“firstMatch”:[]}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“automationName”:“uiautomator2”,“platformName”:“Android”,“deviceName”:“emulator-5554”},{},{“desiredCapabilities”:{“appPackage”:“com.android.calculator2”,“appActivity”:“com.android.calculator2.Calculator”,“automationName”:“uiautomator2”,“platformName”:“Android”,“deviceName”:“emulator-5554”},“requiredCapabilities”:{},“alwaysMatch”:{“platformName”:“Android”},“firstMatch”:[]}]
[BaseDriver] Event ‘newSessionRequested’ logged at 1571141723718 (09:15:23 GMT-0300 (-03))
[Appium] Merged W3C capabilities {“desiredCapabilities”:{“appPackage”:“com.andro… into desiredCapabilities object {“appPackage”:“com.android.calculator2”,“appAct…
[Appium] Creating new AndroidUiautomator2Driver (v0.11.0) session
[Appium] Capabilities:
[Appium] appPackage: com.android.calculator2
[Appium] appActivity: com.android.calculator2.Calculator
[Appium] automationName: uiautomator2
[Appium] platformName: Android
[Appium] deviceName: emulator-5554
[BaseDriver] Session created with session id: 8bc5392c-a41c-4746-8207-30903d0e8e88
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_221
[ADB] Checking whether adb is present
[ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
[ADB] Using adb from /usr/bin/adb
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[AndroidDriver] Using device: 0054714774
[ADB] Checking whether adb is present
[ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
[ADB] Using adb from /usr/bin/adb
[ADB] Setting device id to 0054714774
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: [”-P”,5037,"-s",“0054714774”,“shell”,“getprop”,“ro.build.version.sdk”]
[ADB] Current device property ‘ro.build.version.sdk’: 28
[ADB] Device API level: 28
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Getting device platform version
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“getprop”,“ro.build.version.release”]
[ADB] Current device property ‘ro.build.version.release’: 9
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“wm”,“size”]
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“wm”,“density”]
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“getprop”,“ro.product.model”]
[ADB] Current device property ‘ro.product.model’: moto g(7) play
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“getprop”,“ro.product.manufacturer”]
[ADB] Current device property ‘ro.product.manufacturer’: motorola
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“am”,“force-stop”,“io.appium.uiautomator2.server”]
[ADB] Checking whether aapt is present
[ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for aapt.
[ADB] Using aapt from /usr/bin/aapt
[ADB] Getting install status for io.appium.uiautomator2.server
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“pm”,“list”,“packages”,“io.appium.uiautomator2.server”]
[ADB] App is not installed
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“pm”,“list”,“packages”,“io.appium.uiautomator2.server.test”]
[ADB] App is not installed
[ADB] Checking app cert for /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-driver/uiautomator2/appium-uiautomator2-server-v0.3.0.apk
[ADB] Cannot use apksigner tool for signature verification. Defaulting to verify.jar. Original error: ENOENT: no such file or directory, scandir ‘/home/grandpix/build-tools’
[ADB] ‘/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-driver/uiautomator2/appium-uiautomator2-server-v0.3.0.apk’ is not signed with debug cert.
[ADB] Signing ‘/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-driver/uiautomator2/appium-uiautomator2-server-v0.3.0.apk’ with default cert
[ADB] Cannot use apksigner tool for signing. Defaulting to sign.jar. Original error: ENOENT: no such file or directory, scandir ‘/home/grandpix/build-tools’
[ADB] Resigning apk.
[ADB] Error: Could not sign with default certificate. Original error Command ‘/usr/lib/jvm/jdk1.8.0_221/bin/java -jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-adb/jars/sign.jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-driver/uiautomator2/appium-uiautomator2-server-v0.3.0.apk --override’ exited with code 1
at Object.wrappedLogger.errorAndThrow (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:69:13)
at ADB.callee$0$0$ (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:74:11)
at tryCatch (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at
Error: Could not sign with default certificate. Original error Command ‘/usr/lib/jvm/jdk1.8.0_221/bin/java -jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-adb/jars/sign.jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-driver/uiautomator2/appium-uiautomator2-server-v0.3.0.apk --override’ exited with code 1
at Object.wrappedLogger.errorAndThrow (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:69:13)
at ADB.callee$0$0$ (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:74:11)
at tryCatch (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: Error: Trying to proxy a session command without session id
[ADB] Getting connected devices…
[ADB] 2 device(s) connected
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“shell”,“am”,“force-stop”,“com.android.calculator2”]
[ADB] Removing forwarded port socket connection: 8200
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“forward”,"–remove",“tcp:8200”]
[ADB] Running ‘/usr/bin/adb’ with args: ["-P",5037,"-s",“0054714774”,“forward”,"–remove",“tcp:8200”]
[UiAutomator2] Unable to remove port forward ‘Error executing adbExec. Original error: ‘Command ‘/usr/bin/adb -P 5037 -s 0054714774 forward --remove tcp:8200’ exited with code 1’; Stderr: ‘error: listener ‘tcp:8200’ not found’; Code: ‘1’’
[MJSONWP] Encountered internal error running command: Error: Could not sign with default certificate. Original error Command ‘/usr/lib/jvm/jdk1.8.0_221/bin/java -jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-adb/jars/sign.jar /tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-driver/uiautomator2/appium-uiautomator2-server-v0.3.0.apk --override’ exited with code 1
at Object.wrappedLogger.errorAndThrow (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:69:13)
at ADB.callee$0$0$ (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:74:11)
at tryCatch (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/tmp/.mount_appiumG1fgpJ/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at
[HTTP] <-- POST /wd/hub/session 500 2090 ms - 527

Hi, I think you had an issue because you didn’t set your $ANDROID_HOME right.

The command was found but it couldn’t be executed because of the certificate issue. This most likely is due to how Node.js and Appium were installed (never install them with sudo; install Node.js manually and then run npm install -g appium).

Although, in this case his old version of Appium may be part of the cause. Check https://github.com/appium/appium/issues/11655.

How do I get the Appium log as in the original post? I think I have a similar problem, I wrote about it here:

First I’m getting the certificate signing error then I’m getting another error.

How did you install node.js and Appium? Like, the exact steps.