Uploaded image for project: 'Appcelerator CLI'
  1. Appcelerator CLI
  2. CLI-629

Building on Windows fails if the CLI forks the build command due to mismatched SDK versions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 4.0.0
    • Fix Version/s: Release 4.0.0, Release 4.1.0
    • Component/s: Titanium
    • Labels:
    • Environment:

      Windows 8.1
      Appc Studio: 4.0.0.201505120319
      Titanium SDK build: 4.0.0.v20150511112612
      Appc CLI (NPM): 0.3.55
      Appc CLI (Registry): 0.2.282

    • Severity:
      Blocker

      Description

      Description

      When building an app, if the tiapp.xml SDK setting and the selected SDK in the CLI config is different then the CLI will fork the command to use the SDK set in the tiapp.xml.

      On Windows this is failing, the command that is created for forking is the following

      [INFO]  tiapp.xml <sdk-version> set to 4.0.0.RC3, but current Titanium SDK set to 4.0.0.v20150511112612
      [INFO]  Forking correct SDK command: "C:\Program Files (x86)\nodejs\node.exe" "Files (x86)\nodejs\node.exe C:\Users\Windo_000\.appcelerator\install\0.2.282\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" "build" "--sdk" "4.0.0.RC3" "--no-banner" "--config-file" "C:\Users\WINDO_~1\AppData\Local\Temp\build-1431478668393.json" "--platform" "android" "--project-dir" "C:\Users\Windo_000\Documents\Appcelerator_Studio_Workspace\smokeySmokeAlloy" "--log-level" "info" "--android-sdk" "C:\android-sdk-win" "--target" "device"
      

      and the error it throws is

      module.js:340
          throw err;
                ^
      Error: Cannot find module 'C:\Users\Windo_000\Documents\Appcelerator_Studio_Workspace\smokeySmokeAlloy\Files (x86)\nodejs\node.exe C:\Users\Windo_000\
      .appcelerator\install\0.2.282\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium'
          at Function.Module._resolveFilename (module.js:338:15)
          at Function.Module._load (module.js:280:25)
          at Function.Module.runMain (module.js:497:10)
          at startup (node.js:119:16)
          at node.js:935:3
      ERROR  | ti run exited with error code 8
      

      I believe this is an appc cli bug, as when performing the same task from titanium cli it works with no issues

      Steps To Reproduce

      1. On a Windows machine create a new project appc new
      2. Select a new SDK using appc ti sdk select
      3. Run the project using appc run -p android

      Actual Result

      The build will error out

      Expected Result

      The build should not error our

        Attachments

          Activity

            People

            • Assignee:
              fmiao Feon Sua Xin Miao
              Reporter:
              eharris Ewan Harris
              Reviewer:
              Feon Sua Xin Miao
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code