appium / appium-docker-android

Appium Server setup to automate android testing on real devices
https://hub.docker.com/r/appium/
Other
585 stars 228 forks source link

Huge crash on connection: #132

Closed itaishalom closed 1 year ago

itaishalom commented 4 years ago

Hi, I'm trying to run appium with selenium and I get a crash on the following line:

androidDriver = AndroidDriver(URL("http://localhost:4723/wd/hub"), capabilities) The error:

Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/root/platform-tools/adb -P 5037 -s 18131522505366 install -r /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' exited with code 1'; Stderr: 'adb: failed to install /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl224600846.tmp/base.apk: META-INF/CERT.SF has invalid digest for javax/annotation/meta/Exclusive.java in /data/app/vmdl224600846.tmp/base.apk]'; Code: '1' Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'jenkins', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.3.0-62-generic', java.version: '11.0.7' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/root/platform-tools/adb -P 5037 -s 18131522505366 install -r /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' exited with code 1'; Stderr: 'adb: failed to install /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl224600846.tmp/base.apk: META-INF/CERT.SF has invalid digest for javax/annotation/meta/Exclusive.java in /data/app/vmdl224600846.tmp/base.apk]'; Code: '1' at getResponseForW3CError (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9) at asyncHandler (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:392:37) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'jenkins', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.3.0-62-generic', java.version: '11.0.7' Driver info: driver.version: AndroidDriver

The docker file:

`selenium_hub: image: selenium/hub:3.141.59-20200525 container_name: selenium-hub privileged: true ports:

Hos machine - ubuntu 18.04

logs from server: appium_android_device_1 | [debug] [ADB] '/usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.5.5.apk' is signed with the default certificate appium_android_device_1 | [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test appium_android_device_1 | [debug] [ADB] Running '/root/platform-tools/adb -P 5037 -s 18131522505366 shell dumpsys package io.appium.uiautomator2.server.test' appium_android_device_1 | [debug] [ADB] 'io.appium.uiautomator2.server.test' is not installed appium_android_device_1 | [debug] [ADB] Checking app cert for /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk appium_android_device_1 | [debug] [ADB] Starting apksigner: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xmx1024M -Xss1m -jar /root/build-tools/30.0.1/lib/apksigner.jar verify --print-certs /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk appium_android_device_1 | [ADB] Cannot use apksigner tool for signature verification. Original error: Command '/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xmx1024M -Xss1m -jar /root/build-tools/30.0.1/lib/apksigner.jar verify --print-certs /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' exited with code 1 appium_android_device_1 | [debug] [ADB] Defaulting to verify.jar appium_android_device_1 | [debug] [ADB] '/usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' is not signed with the default certificate appium_android_device_1 | [debug] [ADB] Exception in thread "main" java.lang.Exception: Invalid cert. appium_android_device_1 | [debug] [ADB] at v.Verify.verify(Verify.java:57) appium_android_device_1 | [debug] [ADB] at v.Verify.main(Verify.java:72) appium_android_device_1 | [debug] [ADB] appium_android_device_1 | [ADB] Using 'zipalign' from '/root/build-tools/30.0.1/zipalign' appium_android_device_1 | [debug] [ADB] /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' is already zip-aligned. Doing nothing appium_android_device_1 | [debug] [ADB] Signing '/usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' with default cert appium_android_device_1 | [debug] [ADB] Starting apksigner: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xmx1024M -Xss1m -jar /root/build-tools/30.0.1/lib/apksigner.jar sign --key /usr/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8 --cert /usr/lib/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk appium_android_device_1 | [ADB] Cannot use apksigner tool for signing. Defaulting to sign.jar. Original error: Error: A JNI error has occurred, please check your installation and try again appium_android_device_1 | [ADB] Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 appium_android_device_1 | [ADB] at java.lang.ClassLoader.defineClass1(Native Method) appium_android_device_1 | [ADB] at java.lang.ClassLoader.defineClass(ClassLoader.java:756) appium_android_device_1 | [ADB] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) appium_android_device_1 | [ADB] at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) appium_android_device_1 | [ADB] at java.net.URLClassLoader.access$100(URLClassLoader.java:74) appium_android_device_1 | [ADB] at java.net.URLClassLoader$1.run(URLClassLoader.java:369) appium_android_device_1 | [ADB] at java.net.URLClassLoader$1.run(URLClassLoader.java:363) appium_android_device_1 | [ADB] at java.security.AccessController.doPrivileged(Native Method) appium_android_device_1 | [ADB] at java.net.URLClassLoader.findClass(URLClassLoader.java:362) appium_android_device_1 | [ADB] at java.lang.ClassLoader.loadClass(ClassLoader.java:418) appium_android_device_1 | [ADB] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) appium_android_device_1 | [ADB] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) appium_android_device_1 | [ADB] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495) appium_android_device_1 | [ADB] appium_android_device_1 | [debug] [ADB] Starting sign.jar: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar /usr/lib/node_modules/appium/node_modules/appium-adb/jars/sign.jar /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk --override

budtmo commented 1 year ago

close the issue as it might be fixed on the newest release. feel free to reopen the issue if the error still there