Appium can not install appium-uiautomator2-server-debug-androidTest.apk on device

Appium v1.17.1
Device Android 7.0
jdk1.8.0_202.jdk

Description:
Appium can not install appium-uiautomator2-server-debug-androidTest.apk on device

Appium logs:
‘adb: failed to install /Applications/Appium.app/Contents/Resources/app/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/vmdl506038121.tmp/base.apk: META-INF/CERT.SF has invalid digest for javax/annotation/meta/Exclusive.java in /data/app/vmdl506038121.tmp/base.apk]’; Code: ‘1’
[MJSONWP] Error: Command ‘/Volumes/MacMini/Users/Shared/dev-tools/Android/sdk/platform-tools/adb -P 5037 -s 3300b85a49238397 install -r /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’ exited with code 1
[MJSONWP] at ChildProcess. (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/teen_process/lib/exec.js:113:19)
[MJSONWP] at ChildProcess.emit (events.js:203:13)
[MJSONWP] at maybeClose (internal/child_process.js:1021:16)
[MJSONWP] at Socket. (internal/child_process.js:430:11)
[MJSONWP] at Socket.emit (events.js:203:13)
[MJSONWP] at Pipe. (net.js:588:12)
[MJSONWP] Destroying socket connection

Install and change the JAVA_HOME from jdk1.8.0_202.jdk to the newer version in your path. Java 14 works fine.

Thanks for answer but I tried and it did not work (I tried for jdk 11 and 14). That error has appeared since appium 1.17.1 and it is for Android 7 (for android 8 it is work). For appium 1.15.1 it is work on Android 7. I do not know whats wrong.

2 Likes

I have the same issue with Appium 1.17.1 and Android 7:

2020-07-11 02:44:02:833 [W3C] Encountered internal error running command: Error executing adbExec. Original error: 'Command 'C:\\Users\\james\\AppData\\Local\\Android\\platform-tools\\adb.exe -P 5037 -s 11160b52158f0202 install -r C:\\Users\\james\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk' exited with code 1'; Stderr: 'adb: failed to install C:\Users\james\AppData\Roaming\npm\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/vmdl1583867004.tmp/base.apk: META-INF/CERT.SF has invalid digest for javax/annotation/meta/Exclusive.java in /data/app/vmdl1583867004.tmp/base.apk]'; Code: '1'
2020-07-11 02:44:02:833 [W3C] Error: Command 'C:\\Users\\james\\AppData\\Local\\Android\\platform-tools\\adb.exe -P 5037 -s 11160b52158f0202 install -r C:\\Users\\james\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk' exited with code 1
2020-07-11 02:44:02:833 [W3C]     at ChildProcess.<anonymous> (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\exec.js:113:19)
2020-07-11 02:44:02:833 [W3C]     at ChildProcess.emit (events.js:223:5)
2020-07-11 02:44:02:834 [W3C]     at maybeClose (internal/child_process.js:1021:16)
2020-07-11 02:44:02:834 [W3C]     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
2020-07-11 02:44:02:835 [W3C] ---------------------------------------------
2020-07-11 02:44:02:835 [W3C]     at C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\exec.js:105:10
2020-07-11 02:44:02:835 [W3C]     at Promise.cancellationExecute [as _execute] (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\bluebird\js\release\debuggability.js:406:9)
2020-07-11 02:44:02:835 [W3C]     at Promise._resolveFromExecutor (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\bluebird\js\release\promise.js:518:18)
2020-07-11 02:44:02:835 [W3C]     at new Promise (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\bluebird\js\release\promise.js:103:10)
2020-07-11 02:44:02:836 [W3C]     at exec (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\exec.js:32:16)
2020-07-11 02:44:02:836 [W3C]     at execFunc (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:324:28)
2020-07-11 02:44:02:836 [W3C]     at ADB.adbExec (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:373:18)
2020-07-11 02:44:02:836 [W3C]     at performAppInstall (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:523:50)
2020-07-11 02:44:02:837 [W3C]     at ADB.install (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:571:26)
2020-07-11 02:44:02:837 [W3C]     at UiAutomator2Server.installServerApk (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:121:11)
2020-07-11 02:44:02:837 [W3C]     at AndroidUiautomator2Driver.initUiAutomator2Server (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:440:7)
2020-07-11 02:44:02:837 [W3C]     at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:338:5)
2020-07-11 02:44:02:837 [W3C]     at AndroidUiautomator2Driver.createSession (C:\Users\james\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:212:7)
2020-07-11 02:44:02:838 [W3C]     at AppiumDriver.createSession (C:\Users\james\AppData\Roaming\npm\node_modules\appium\lib\appium.js:358:35)
2020-07-11 02:44:02:839 [W3C] Destroying socket connection
2020-07-11 02:44:02:839 [HTTP] <-- POST /wd/hub/session 500 18082 ms - 2201
2020-07-11 02:44:02:840 [HTTP]