Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17347] Android: Install fails. Object has no method 'indexOf'

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-07-21T20:58:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, CLI
Labelsadb, android, cli, install
ReporterFar
AssigneeChris Barber
Created2014-07-18T10:26:04.000+0000
Updated2017-03-16T22:26:34.000+0000

Description

Error was made in https://github.com/appcelerator/titanium_mobile/commit/6d006eba6bc1100fb94e8046e7e53f4ec11f297e. android/cli/hooks/run.js:
...
(function installApp() {
    adb.shell(device.id, 'ps', function (err, output) {
        if (output.indexOf('system_server') === -1) {
        ...
'output' isn't a string so the toString() conversion doesn't work. This creates a problem installing to Android devices It's more correct to use getPid() from adb.js.

Attachments

FileDateSize
build_log.txt2014-07-18T16:35:01.000+00008709
TIMOB17347.log2014-07-21T11:45:11.000+000045714

Comments

  1. Ingo Muschenetz 2014-07-18

    Thank you for the suggestion. Can you give us a way to reproduce the problem? What is the error you get when it happens?
  2. Chris Barber 2014-07-18

    Master: https://github.com/appcelerator/titanium_mobile/pull/5915 3_3_X: https://github.com/appcelerator/titanium_mobile/pull/5916
  3. Olga Romero 2014-07-18

    I simply ran
       ti build -p android -T device
       ti build -p android -T emulator
       
    I both cases the app successfully installed.
  4. Chris Barber 2014-07-18

    [~farwayer] I see the error you are getting and I believe I have fixed in in the PRs above, however the QE team is having a bear of a time trying to reproduce this. We have tested Android builds on Linux with 3.3.0.GA and cannot reproduce. Can you help us by letting us know what exact OS you are using, what version on Node.js, what version of the Android build/platform/sdk tools, what Android target SDK, and what device? Thank you!
  5. Far 2014-07-18

    Of course, guys:
       titanium_mobile 82fd1b1
       titanium@3.4.0-dev (git://github.com/appcelerator/titanium.git#f6ae085562535fb0a76f20d3749627423b65d345)
       nodejs v0.10.29
       adb 1.0.31
       android-sdk r23.0.2
       android-sdk-build-tools r20
       android-sdk-platform-tools r20
       android-platform 4.4.2_r03
       genymotion 2.2.2 with 2.3.7
       
    -ti info attached- can't attach new file, appended to comment
       Operating System
         Name                        = GNU/Linux
         Version                     = 
         Architecture                = 64bit
         # CPUs                      = 8
         Memory                      = 7.7GB
       
       Node.js
         Node.js Version             = 0.10.29
         npm Version                 = 1.4.14
       
       Titanium CLI
         CLI Version                 = 3.4.0-dev
         node-appc Version           = 0.2.14
       
       Titanium SDKs
         3.4.0
           Version                   = 3.4.0
           Install Location          = /home/farwayer/.titanium/mobilesdk/linux/3.4.0
           Platforms                 = mobileweb, android
           git Hash                  = 82fd1b1
           git Timestamp             = 07/18/14 22:27
           node-appc Version         = 0.2.12
        
       Intel® Hardware Accelerated Execution Manager (HAXM)
         Not installed
       
       Java Development Kit
         Version                     = 1.7.0_65
         Java Home                   = /usr/lib/jvm/java-7-openjdk
       
       Genymotion
         Path                        = /usr/bin
         Genymotion Executable       = /usr/bin/genymotion
         Genymotion Player           = not found
         Home                        = /home/farwayer/.Genymobile/Genymotion
       
       VirtualBox
         Executable                  = /usr/bin/VBoxManage
         Version                     = 4.3.14_OSEr95030
       
       Android SDK
         Android Executable          = /opt/android-sdk/tools/android
         ADB Executable              = /opt/android-sdk/platform-tools/adb
         SDK Path                    = /opt/android-sdk
       
       Android NDK
         NDK Path                    = /opt/android-ndk
         NDK Version                 = r9d (64-bit)
       
       Android Platforms
         1) android-17
           Name                      = Android 4.2.2
           API Level                 = 17
           Revision                  = 2
           Skins                     = WSVGA, WVGA854, WXGA800, HVGA, WXGA800-7in, WQVGA400, WVGA800, QVGA, WQVGA432, WXGA720
           ABIs                      = no ABIs.
           Path                      = /opt/android-sdk/platforms/android-17
         2) android-19
           Name                      = Android 4.4.2
           API Level                 = 19
           Revision                  = 3
           Skins                     = WSVGA, WVGA854, WXGA800, HVGA, WXGA800-7in, WQVGA400, WVGA800, QVGA, WQVGA432, WXGA720
           ABIs                      = no ABIs.
           Path                      = /opt/android-sdk/platforms/android-19
       
       Android Add-Ons
         3) Google Inc.:Google APIs:17
           Name                      = Android 4.2.2 (API level 17)
           Vendor                    = Google Inc.
           Revision                  = 3
           Description               = Android + Google APIs
           Skins                     = WXGA800, WXGA720, WVGA800, WQVGA400, HVGA, WSVGA, WXGA800-7in, WQVGA432, QVGA, WVGA854
           ABIs                      = armeabi-v7a
           Path                      = /opt/android-sdk/add-ons/addon-google_apis-google-17
           Libraries                 = com.google.android.media.effects: Collection of video effects (effects.jar)
                                       com.android.future.usb.accessory: API for USB Accessories (usb.jar)
                                       com.google.android.maps: API for Google Maps (maps.jar)
       
       
       Android Emulators
         None
       
       Genymotion Emulators
         Google Nexus One - 2.3.7 - API 10 - 480x800
           SDK Version               = 2.3.7
           ABI                       = x86
           Genymotion Version        = 2.2.2
           Display                   = 480x800-16
           DPI                       = 240
           OpenGL Acceleration       = yes
           Google APIs               = no
         Samsung Galaxy S5 - 4.4.2 - API 19 - 1080x1920
           SDK Version               = 4.4.2 (android-19)
           ABI                       = x86
           Genymotion Version        = 2.2.2
           Display                   = 1080x1920-16
           DPI                       = 480
           OpenGL Acceleration       = yes
           Google APIs               = unknown, emulator not running
         Motorola Moto X - 4.4.2 - API 19 - 720x1280
           SDK Version               = 4.4.2 (android-19)
           ABI                       = x86
           Genymotion Version        = 2.2.2
           Display                   = 720x1280-16
           DPI                       = 320
           OpenGL Acceleration       = yes
           Google APIs               = unknown, emulator not running
       
       Connected Android Devices
         None
       
       Genymotion Issues
         ✕  Unable to locate the Genymotion "player" executable.
       
  6. Chris Barber 2014-07-18

    [~farwayer] Great! Which Linux distro and which Android device are you using?
  7. Far 2014-07-18

    I am using Arch linux. application is successfully installed to device but not to genymotion emulator.
  8. Chris Barber 2014-07-18

    [~farwayer] Yeah, we just fixed the Genymotion issue with TIMOB-17344. You can get the fix by running:
       ti sdk install -b 3_3_X -d
       
  9. Far 2014-07-19

    Hm, just tested behavior with standart android emulator. All ok. Look like the problem appear on Genymotion only. But it's another problem than TIMOB-17344. Commit from TIMOB-17344 didn't help me.
  10. Dhirendra Jha 2014-07-21

    I tried and able to reproduce this issue. See the details below - Environment - acs@1.0.15 alloy@1.4.0 npm@1.3.2 titanium@3.3.0 titanium-code-processor@1.1.1 OS - Ubuntu 12.04 Appcelerator Studio - 3.3.0.201407111535 1) Configured Ubuntu 12.04 system with current 3.3.0 GA environment. 2) Configured Genymotion on the system. 3) Verified that Studio detect the Genymotion configuration correctly. 4) Created a default classic project. 5) From the CLI, run the command - ti build -p android -T emulator -C "GoogleNexus5-4.4.2-API 19-1080x1920" Result - Got the same error as mentioned in this issue. 6) Removed the "modules" folder and 3.3.0 GA build from .titanium folder. 7) Download the build (linux 2) as mentioned in the issue TISTUD-6730. 8) Install the above SDK build from Studio. 9) Run the app again with the same command mentioned in the step 5. Result - Again got the same error message. App did not install on Genymotion emulator. See the attached CLI log file.
  11. Tim Poulsen 2014-07-21

    I tested this on Mac OS X using the PR above. I was able to install to a Genymotion emulator without issues. I'm not sure if this is a valid test or if the issue exists solely on Linux.
  12. Far 2014-07-21

    Yep, with PR all ok also on Linux.
  13. Chris Barber 2014-07-21

    [~skypanther] I say we just merge this. The change is low risk and is verified by [~farwayer].
  14. Tim Poulsen 2014-07-21

    Approved and merged
  15. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source