Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25232] Windows: CLI fails when running any appc commands

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-09-07T17:35:09.000+0000
Affected Version/swindowslib 0.5.4
Fix Version/sRelease 6.2.0, windowslib 0.5.5
ComponentsAndroid, Windows
Labelsn/a
ReporterHans Knöchel
AssigneeKota Iguchi
Created2017-09-06T18:35:44.000+0000
Updated2018-08-06T17:49:35.000+0000

Description

When building for Android on Windows (appc run), the build crashes with the attached error. Same occurs for all other appc commands, e.g. appc ti info, so we are unable to get the environment. Logging out and in also didn't resolve the issue. EDIT: The Ti CLI was outdated, after updating it to 5.0.14, the Appc-CLI to 6.2.3 and the SDK to 6.1.2, the new error is:
\
C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\visualstudio.js:65
                        next(null, JSON.parse(out));
                   ^
SyntaxError: Unexpected end of JSON input
    at Object.parse (native)
    at ChildProcess.<anonymous> (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\visualstudio.js:65:20)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
---------------------------------------------
    at runVS2017Tool (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\visualstudio.js:53:8)
    at detectVS2017Installations (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\visualstudio.js:105:2)
    at detectInstallations (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\visualstudio.js:146:2)
    at C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\visualstudio.js:94:3
    at C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\utilities.js:49:3
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
---------------------------------------------
    at magik (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\utilities.js:34:10)
    at Object.detect (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\visualstudio.js:88:9)
    at C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\index.js:80:8
    at C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\node_modules\async\lib\async.js:181:20
    at Object.async.forEachOf.async.eachOf (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\node_modules\async\lib\async.js:233:13)
    at Object.async.forEach.async.each (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\node_modules\async\lib\async.js:209:22)
    at C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\index.js:79:9
    at C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\utilities.js:49:3
---------------------------------------------
    at magik (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\lib\utilities.js:34:10)
    at Object.detect (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\node_modules\windowslib\index.js:58:9)
    at Section.exports.detect (C:\Users\7strel\AppData\Roaming\Titanium\mobilesdk\win32\6.1.2.GA\windows\cli\lib\info.js:26:13)
    at C:\Users\7strel\AppData\Roaming\npm\node_modules\titanium\lib\commands\info.js:604:13
    at C:\Users\7strel\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:3845:9
    at eachOfArrayLike (C:\Users\7strel\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:1089:9)
    at eachOf (C:\Users\7strel\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:1139:5)
    at _parallel (C:\Users\7strel\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:3844:5)
    at Object.parallelLimit [as parallel] (C:\Users\7strel\AppData\Roaming\npm\node_modules\titanium\node_modules\async\dist\async.js:3924:3)

Attachments

FileDateSize
Unknown.png2017-09-06T18:35:36.000+0000145817

Comments

  1. Feon Sua Xin Miao 2017-09-06

    Looks like ti info blows up for the developer, probably development environment setup issue. That said, appc should be more resilient.
  2. Kota Iguchi 2017-09-07

    windowslib 0.5.5: https://github.com/appcelerator/windowslib/pull/79 We also need to push this changes to titanium_mobile in order to close this ticket.
  3. Christopher Williams 2017-09-07

    Merged the windowslib PR, waiting for it to build and publish before updating titanium_mobile...
  4. Christopher Williams 2017-09-07

    Merged PR, updated titanium_mobile to use windowslib 0.5.5
  5. Hans Knöchel 2017-09-07

    Does this really fix the issue? The developer needed to execute the VS-related setup.exe manually which resolved the issue for him. Asking different: Is the JSON.parse supposed to throw in a non-error case?
  6. Kota Iguchi 2017-09-07

    [~hknoechel] I was not able to reproduce this issue but I believe my fix works for this particular issue (the SyntaxError: Unexpected end of JSON input).
       JSON.parse('{');
       
       try {
         JSON.parse('{');
       } catch (E) {
         console.log('yeah');
       }
       
    It was originally thrown because Visual Studio 2017 detection tool returns unexpected output for some reason, but windowslib should not error out even in this case.
  7. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source