Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22334

plugin thinks emulator always crashes using sdk 22.6.1

    XMLWordPrintable

Details

    Description

      Running android unit tests from gradle is not possible anymore using the latest android sdk (22.6.1). Using 22.3 everything was fine.
      Running the same tests locally without jenkins everything is fine too.

      Behavior seen is that the jenkins plugins seems to think that the emulator has crashed and hence stops the tests. Output seen from the gradle script:

      Starting 115 tests on sdk - 4.3

      com.example.MyTest > testAndroidTestCaseSetupProperly[sdk - 4.3] FAILED 
      Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Process crashed.''. Check device logcat for details
      Tests on sdk - 4.3 failed: Instrumentation run failed due to 'Process crashed.'
      Starting 115 tests on emulator-38135 - 4.3

      com.example.MyTest > testAndroidTestCaseSetupProperly[emulator-38135 - 4.3] SUCCESS 
      --> then the tests stop executing. Also strange to notice is that is seems to try to restart a new emulator with the name "emulator-38135" instead of the normal name "sdk"

      Logcat output is not very helpful, something seems to force-stop the tests:
      03-25 04:12:16.633 I/ActivityManager( 285): Start proc com.mypackage.library.test for added application com.mypackage.library.test: pid=1622 uid=10046 gids=

      {50046, 3003, 1028}

      03-25 04:12:17.453 I/TestRunner( 1622): started: testAndroidTestCaseSetupProperly(com.mypackage.MyFirstTest)
      ....
      03-25 04:12:19.763 I/ActivityManager( 285): Force stopping package com.mypackage.library.test appid=10046 user=0
      03-25 04:12:19.763 I/ActivityManager( 285): Killing proc 1622:com.mypackage.library.test/u0a10046: force stop com.mypackage.library.test
      03-25 04:12:19.783 W/ActivityManager( 285): Crash of app com.mypackage.library.test running instrumentation ComponentInfo

      {com.mypackage.library.test.test/android.test.InstrumentationTestRunner}

      Attachments

        1. consoleText
          1.47 MB
        2. logcat.txt
          326 kB

        Activity

          Pauli Kaupppinen (or anyone else) - do you know of a workaround for Gradle builds similar to the one suggested (-Dandroid.device=usb)?

          elevenfive Matthew Zavislak added a comment - Pauli Kaupppinen (or anyone else) - do you know of a workaround for Gradle builds similar to the one suggested (-Dandroid.device=usb)?
          elevenfive Matthew Zavislak added a comment - - edited

          I attached a 1-liner pull request that might be a good candidate for how to solve this bug. If anyone is blocked by this issue, I recommend cherry picking this fix and building your own version of the plugin.

          If building your own, keep in mind you will have to modify the POM to give a different plugin name in order to not conflict with the official version.

          Edit: the link is above but I'm adding it here for convenience. https://github.com/jenkinsci/android-emulator-plugin/pull/36

          elevenfive Matthew Zavislak added a comment - - edited I attached a 1-liner pull request that might be a good candidate for how to solve this bug. If anyone is blocked by this issue, I recommend cherry picking this fix and building your own version of the plugin. If building your own, keep in mind you will have to modify the POM to give a different plugin name in order to not conflict with the official version. Edit: the link is above but I'm adding it here for convenience. https://github.com/jenkinsci/android-emulator-plugin/pull/36

          I have following script that removes the local emulator instance.

          adb devices | grep local | awk '

          {print $1;}

          ' | xargs /var/jenkins/tools/android-sdk/platform-tools/adb disconnect

          I run it as first build step.

          __pauli__ Pauli Kaupppinen added a comment - I have following script that removes the local emulator instance. adb devices | grep local | awk ' {print $1;} ' | xargs /var/jenkins/tools/android-sdk/platform-tools/adb disconnect I run it as first build step.

          Version 2.11 of the plugin has been released, which fixes this issue.

          orrc Christopher Orr added a comment - Version 2.11 of the plugin has been released, which fixes this issue.
          maxzilla Max Wahler added a comment -

          I'm experiencing the issue now after updating from 2.12 to 2.13.1. I use the latest Android SDK & tools.

          After the emulator was started, I see two devices albeit only one emulator instance is running:

          Mac-mini-Yosemite:~ blueid$ /opt/android-sdk/platform-tools/adb -P 6813 devices
          List of devices attached
          emulator-6811 device
          localhost:6812 device

          Is this some kind of regression?

          maxzilla Max Wahler added a comment - I'm experiencing the issue now after updating from 2.12 to 2.13.1. I use the latest Android SDK & tools. After the emulator was started, I see two devices albeit only one emulator instance is running: Mac-mini-Yosemite:~ blueid$ /opt/android-sdk/platform-tools/adb -P 6813 devices List of devices attached emulator-6811 device localhost:6812 device Is this some kind of regression?

          People

            orrc Christopher Orr
            mouse256 Tom Billiet
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: