0
votes

I'm working in a project, so I have the code below:

    DesiredCapabilities cap = new DesiredCapabilities();
        
        cap.setCapability(MobileCapabilityType.DEVICE_NAME, "emulator-5554");
        cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android"); //platformName
        cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.1.1"); //platformVersion

        cap.setCapability("appPackage","com.android.dialer");
        cap.setCapability("appActivity","com.android.dialer.DialtactsActivity");

Bu the problem is, I'm getting this error:

An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\dnkos\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -r C:\Users\dnkos\AppData\Local\Programs\Appium\resources\app\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\dnkos\AppData\Local\Programs\Appium\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/vmdl2090851678.tmp/base.apk: META-INF/CERT.SF has invalid digest for javax/annotation/meta/Exclusive.java in /data/app/vmdl2090851678.tmp/base.apk]'; Code: '1'

What could be wrong?

1
Welcome to stackoverflow! Remember always try to detail your problem with the code with you already done. Please, avoid only pasting code and error codes without any details, because will be difficult for someone try to figure it out what is going ontdmsoares

1 Answers

0
votes

It looks like the app is not signed properly. properly signed.

You can search for apksigner.bat inside Android SDK and run it this way:

sign --key C:\Users\dnkos\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.pk8 --cert C:\Users\dnkos\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\keys\testkey.x509.pem C:\Users\dnkos\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk

If it won't work then it is probably APK signer issue and you might need to try updating Android SDK to the latest one or try to use different emulator/Android OS version.

Alternatively, you may give a try adding noSign capability with true value