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

android.util.AndroidException: Can't connect to activity manager; is the system running?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Updated to Android SDK Release 22.6.2
      Ubuntu 12.04

      Jenkins LTS: Jenkins ver. 1.532.2
      Android Emulator Plugin: 2.10
    • Similar Issues:

      Description

      Start seeing some weird random failure after upgraded to 22.6.2 Android SDK.

      I don't think `getprop dev.bootcomplete` (https://github.com/jenkinsci/android-emulator-plugin/search?q=%22dev.bootcomplete%22&ref=cmdform) works anymore with the new SDK to determine the android device is boot finished or not.

      Should we use this `adb shell getprop init.svc.bootanim` ?

      http://stackoverflow.com/questions/3634041/detect-when-android-emulator-is-fully-booted

      2014-04-09 11:43:02 2093 KB/s (2968898 bytes in 1.384s)
      2014-04-09 11:43:04 Error: Could not access the Package Manager.  Is the system running?
      2014-04-09 11:43:04  => success!
      2014-04-09 11:43:04 $ adb logcat -c
      2014-04-09 11:43:04  => success!
      2014-04-09 11:43:04 $ adb shell am instrument -w  -e abc.package com.abc -e abc.notAnnotation com.abc.annotations.ExcludeFromDefault, -e abc.stride 3 -e abc.initial 0 -e abc.annotation com.abc.annotations.UnitTest com.abc.tests/com.abc.AbcInstrumentationTestRunner
      2014-04-09 11:43:06 Error type 2
      2014-04-09 11:43:06 android.util.AndroidException: Can't connect to activity manager; is the system running?
      2014-04-09 11:43:06  => success!
      2014-04-09 11:43:06 $ echo '<testsuites></testsuites>' > test-report.xml; adb pull /data/data/com.abc/app_test_report/test-report.xml test-report.xml
      2014-04-09 11:43:06 remote object '/data/data/com.abc/app_test_report/test-report.xml' does not exist
      2014-04-09 11:43:06  => failure: #<Process::Status: pid=30984,exited(1)>
      2014-04-09 11:43:06 Could not fetch JUnit test report from device/emulator. Outputting empty test report
      

        Attachments

          Activity

          samxiao Sam Xiao created issue -
          samxiao Sam Xiao made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Critical [ 2 ]
          samxiao Sam Xiao made changes -
          Description Start seeing some weird random failure after upgraded to 22.6.2 Android SDK.



          {noformat}
          2014-04-09 11:43:02 2093 KB/s (2968898 bytes in 1.384s)
          2014-04-09 11:43:04 Error: Could not access the Package Manager. Is the system running?
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb logcat -c
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb shell am instrument -w -e lookout.package com.lookout -e lookout.notAnnotation com.lookout.annotations.ExcludeFromDefault, -e lookout.stride 3 -e lookout.initial 0 -e lookout.annotation com.lookout.annotations.UnitTest com.lookout.tests/com.lookout.LookoutInstrumentationTestRunner
          2014-04-09 11:43:06 Error type 2
          2014-04-09 11:43:06 android.util.AndroidException: Can't connect to activity manager; is the system running?
          2014-04-09 11:43:06 => success!
          2014-04-09 11:43:06 $ echo '<testsuites></testsuites>' > test-report.xml; adb pull /data/data/com.lookout/app_test_report/test-report.xml test-report.xml
          2014-04-09 11:43:06 remote object '/data/data/com.lookout/app_test_report/test-report.xml' does not exist
          2014-04-09 11:43:06 => failure: #<Process::Status: pid=30984,exited(1)>
          2014-04-09 11:43:06 Could not fetch JUnit test report from device/emulator. Outputting empty test report
          {noformat}
          Start seeing some weird random failure after upgraded to 22.6.2 Android SDK.


          I don't think `getprop dev.bootcomplete` (https://github.com/jenkinsci/android-emulator-plugin/search?q=%22dev.bootcomplete%22&ref=cmdform) works anymore with the new SDK to determine the android device is boot finished or not.

          Should we use this `adb shell getprop init.svc.bootanim` ?

          http://stackoverflow.com/questions/3634041/detect-when-android-emulator-is-fully-booted


          {noformat}
          2014-04-09 11:43:02 2093 KB/s (2968898 bytes in 1.384s)
          2014-04-09 11:43:04 Error: Could not access the Package Manager. Is the system running?
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb logcat -c
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb shell am instrument -w -e lookout.package com.lookout -e lookout.notAnnotation com.lookout.annotations.ExcludeFromDefault, -e lookout.stride 3 -e lookout.initial 0 -e lookout.annotation com.lookout.annotations.UnitTest com.lookout.tests/com.lookout.LookoutInstrumentationTestRunner
          2014-04-09 11:43:06 Error type 2
          2014-04-09 11:43:06 android.util.AndroidException: Can't connect to activity manager; is the system running?
          2014-04-09 11:43:06 => success!
          2014-04-09 11:43:06 $ echo '<testsuites></testsuites>' > test-report.xml; adb pull /data/data/com.lookout/app_test_report/test-report.xml test-report.xml
          2014-04-09 11:43:06 remote object '/data/data/com.lookout/app_test_report/test-report.xml' does not exist
          2014-04-09 11:43:06 => failure: #<Process::Status: pid=30984,exited(1)>
          2014-04-09 11:43:06 Could not fetch JUnit test report from device/emulator. Outputting empty test report
          {noformat}
          samxiao Sam Xiao made changes -
          Description Start seeing some weird random failure after upgraded to 22.6.2 Android SDK.


          I don't think `getprop dev.bootcomplete` (https://github.com/jenkinsci/android-emulator-plugin/search?q=%22dev.bootcomplete%22&ref=cmdform) works anymore with the new SDK to determine the android device is boot finished or not.

          Should we use this `adb shell getprop init.svc.bootanim` ?

          http://stackoverflow.com/questions/3634041/detect-when-android-emulator-is-fully-booted


          {noformat}
          2014-04-09 11:43:02 2093 KB/s (2968898 bytes in 1.384s)
          2014-04-09 11:43:04 Error: Could not access the Package Manager. Is the system running?
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb logcat -c
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb shell am instrument -w -e lookout.package com.lookout -e lookout.notAnnotation com.lookout.annotations.ExcludeFromDefault, -e lookout.stride 3 -e lookout.initial 0 -e lookout.annotation com.lookout.annotations.UnitTest com.lookout.tests/com.lookout.LookoutInstrumentationTestRunner
          2014-04-09 11:43:06 Error type 2
          2014-04-09 11:43:06 android.util.AndroidException: Can't connect to activity manager; is the system running?
          2014-04-09 11:43:06 => success!
          2014-04-09 11:43:06 $ echo '<testsuites></testsuites>' > test-report.xml; adb pull /data/data/com.lookout/app_test_report/test-report.xml test-report.xml
          2014-04-09 11:43:06 remote object '/data/data/com.lookout/app_test_report/test-report.xml' does not exist
          2014-04-09 11:43:06 => failure: #<Process::Status: pid=30984,exited(1)>
          2014-04-09 11:43:06 Could not fetch JUnit test report from device/emulator. Outputting empty test report
          {noformat}
          Start seeing some weird random failure after upgraded to 22.6.2 Android SDK.


          I don't think `getprop dev.bootcomplete` (https://github.com/jenkinsci/android-emulator-plugin/search?q=%22dev.bootcomplete%22&ref=cmdform) works anymore with the new SDK to determine the android device is boot finished or not.

          Should we use this `adb shell getprop init.svc.bootanim` ?

          http://stackoverflow.com/questions/3634041/detect-when-android-emulator-is-fully-booted


          {noformat}
          2014-04-09 11:43:02 2093 KB/s (2968898 bytes in 1.384s)
          2014-04-09 11:43:04 Error: Could not access the Package Manager. Is the system running?
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb logcat -c
          2014-04-09 11:43:04 => success!
          2014-04-09 11:43:04 $ adb shell am instrument -w -e abc.package com.abc -e abc.notAnnotation com.abc.annotations.ExcludeFromDefault, -e abc.stride 3 -e abc.initial 0 -e abc.annotation com.abc.annotations.UnitTest com.abc.tests/com.abc.AbcInstrumentationTestRunner
          2014-04-09 11:43:06 Error type 2
          2014-04-09 11:43:06 android.util.AndroidException: Can't connect to activity manager; is the system running?
          2014-04-09 11:43:06 => success!
          2014-04-09 11:43:06 $ echo '<testsuites></testsuites>' > test-report.xml; adb pull /data/data/com.abc/app_test_report/test-report.xml test-report.xml
          2014-04-09 11:43:06 remote object '/data/data/com.abc/app_test_report/test-report.xml' does not exist
          2014-04-09 11:43:06 => failure: #<Process::Status: pid=30984,exited(1)>
          2014-04-09 11:43:06 Could not fetch JUnit test report from device/emulator. Outputting empty test report
          {noformat}
          Hide
          orrc Christopher Orr added a comment -

          I'll take a look, though I have the latest SDK tools installed, but managed to start emulators successfully AFAICT.

          Which Android OS version were you creating the emulator with?

          Show
          orrc Christopher Orr added a comment - I'll take a look, though I have the latest SDK tools installed, but managed to start emulators successfully AFAICT. Which Android OS version were you creating the emulator with?
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
          http://jenkins-ci.org/commit/android-emulator-plugin/9bfa98a0b1fb90ee811f9f029c041112f520ec14
          Log:
          JENKINS-22555 Switched to using "init.svc.bootanim" to detect boot completion.

          I saw an Android TV system image that did not use "dev.bootcomplete", even
          although it had (apparently) booted correctly. Other tools seem to be using
          the bootanim variant, and it seems to be working in every case I tested.

          Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/3ddf4b3259db...9bfa98a0b1fb

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java http://jenkins-ci.org/commit/android-emulator-plugin/9bfa98a0b1fb90ee811f9f029c041112f520ec14 Log: JENKINS-22555 Switched to using "init.svc.bootanim" to detect boot completion. I saw an Android TV system image that did not use "dev.bootcomplete", even although it had (apparently) booted correctly. Other tools seem to be using the bootanim variant, and it seems to be working in every case I tested. Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/3ddf4b3259db...9bfa98a0b1fb
          orrc Christopher Orr made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          orrc Christopher Orr added a comment -

          Version 2.13 of the plugin has been released, which includes this fix.

          Show
          orrc Christopher Orr added a comment - Version 2.13 of the plugin has been released, which includes this fix.
          orrc Christopher Orr made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Christopher Orr [ orrc ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 154657 ] JNJira + In-Review [ 207599 ]

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              samxiao Sam Xiao
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: