Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17731] Installation failed, longjohn.js 185 - has no method 'indexOf'

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-01-30T09:09:49.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.4.0
ComponentsAndroid
Labels3.3.0.GA, TCSupport, android, installation, mobile
ReporterGianpaolo
AssigneeChris Barber
Created2014-07-22T09:30:10.000+0000
Updated2020-01-30T16:49:21.000+0000

Description

Hi, when i try to build an application and launch it on the emulator, the console gives me this error:
[INFO] :   Installing apk: /home/username/Documenti/Ti_Workspace/projectName/build/android/bin/projectName-dev-debug.apk
[ERROR] Application Installer abnormal process termination. Process exit value was 8
[TRACE] :  Checking if package manager service is started
/usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:185
        throw e;
              ^
has no method 'indexOf'
complete log here: [Complete Log on PasteBin](http://pastebin.com/Q18pHFsA) this is my complete environment: [Complete Environment on PasteBin](http://pastebin.com/jyiAW5ZN)

Comments

  1. Gianpaolo 2014-07-23

    have found a workaround... file: /home/user/.titanium/mobilesdk/linux/3.3.0.GA/android/cli/hooks/run.js from row 189 to 193 from this
       if (output.indexOf('system_server') === -1) {
       	logger.trace(__('Package manager not started yet, trying again in %sms...', retryInterval));
       	intervalTimer = setTimeout(installApp, retryInterval);
       	return;
       }
       
    to this
       //if (output.indexOf('system_server') === -1) {
       //	logger.trace(__('Package manager not started yet, trying again in %sms...', retryInterval));
       //	intervalTimer = setTimeout(installApp, retryInterval);
       //	return;
       //}
       
  2. Ashley Sommer 2014-08-08

    I have this same problem, using 3.3.0.GA, and latest Android SDK. It appears the issue is caused because the output variable from the 'ps' command is a javascript [object Object] rather than a string. A better workaround is to change line 198 to: if (output.toString().indexOf('system_server') === -1) {
  3. Jérémy Tonneau 2014-08-21

    Hi, I have been recently faced by the same issue. "if (output.toString().indexOf('system_server') === -1) {" saved me !!!! Regards.
  4. Mauro Parra-Miranda 2014-08-21

    Thanks [~daorithos] for the report! [~ingo]: can you please assign Gianpaolo ([~daorithos]) as the Reporter? TIA!
  5. Chris Barber 2020-01-30

    Upon investigation, it seems the fix in the comments was put in place back in 3.4.0. https://github.com/appcelerator/titanium_mobile/pull/5915 Marking as fixed.
  6. Sohail Saddique 2020-01-30

    Fix verified in build: 9.0.0.v20200130071742. The fix that was put in place in 3.4.0 still exists today. Ticket closed.

JSON Source