Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1273

Reinstalling of android-server in android-drone fails when other version is specified

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Optional
    • None
    • 1.0.0.Final
    • Extension - Droidium
    • None

    Description

      Since there is the possibility to have an Android virtual device connected and online while doing some tests so starting up the emulator is not neccessary every time one is testing something, the android-drone module installs (and reinstalls) an android-server.apk on the device in order to prepare it for e.g testing via android-extension-drone.

      When running the test, specifying one version of the apk server (e.g. 2.16), this APK is installed. In the case we are executing the test the second time with the same version of the APK, all is good since the APK is just reinstalled.

      The error arise when we are trying to reinstall the APK when other version of the server is specified (e.g. 2.21.0) because it seems that Android checks upon reinstalling if the certificates of APK files match and in this case, it is not true. The next error appears while doing so:

      org.jboss.arquillian.android.api.AndroidExecutionException: Unable to install APK from (path)/android-server-2.21.0.apk. 
      Command failed with status code: INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
      	at org.jboss.arquillian.android.impl.AndroidDeviceImpl.installPackage(AndroidDeviceImpl.java:169)
      	at org.jboss.arquillian.android.drone.impl.AndroidWebDriverSupport.prepareWebDriverEnvironment(AndroidDroneWebDriverSupport.java:66)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
      	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
      	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      	at org.jboss.arquillian.android.impl.AndroidDeviceSelector.getOrCreateAndroidDevice(AndroidDeviceSelector.java:110)
      

      I would suggest to not only reinstall the package, which is not sufficient,
      but I would check if some package of some particular name is installed and
      after that it should be removed explicitly.

      The command which writes out the list of all installed applications is

      pm list packages -f

      so this can be easilly checked and tested for the presence of the string

      package:/data/app/org.openqa.selenium.android.app-1.apk=org.openqa.selenium.android.app

      or its appropriate part.

      Attachments

        Activity

          People

            smikloso Stefan Miklosovic (Inactive)
            smikloso Stefan Miklosovic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: