Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20057] Windows: Unable to build for any platform if there is no Visual Studio installed

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-11-24T19:12:30.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.1.1
ComponentsTooling, Windows
Labelsn/a
ReporterChee Kiat Ng
AssigneeChristopher Williams
Created2015-11-24T09:04:11.000+0000
Updated2016-06-08T15:30:06.000+0000

Description

Ensure there are no versions of Visual Studio installed.

Attempt to build. There is an error of:

C:\ProgramData\Titanium\mobilesdk\win32\5.1.0.GA\windows\cli\commands\_build\config\vstarget.js:13
var defaultTarget = this.windowsInfo.selectedVisualStudio.version;
TypeError: Cannot read property 'version' of null
See this link https://community.appcelerator.com/topic/4128/issues-with-update-from-4-x-to-5-1

Comments

  1. Ingo Muschenetz 2015-11-24

    I have rolled back the installer versions to 0.12.7 in the meantime while we diagnose the issue.
  2. Chris Barber 2015-11-24

    The problem is because the Windows build doesn't check if the this.windowsInfo.selectedVisualStudio is not null: https://github.com/appcelerator/titanium_mobile_windows/blob/master/cli/commands/_build/config/vstarget.js#L13. Also, the Windows build should set the defaultTarget value to undefined if this.windowsInfo.selectedVisualStudio is not valid:
       var defaultTarget = this.windowsInfo.selectedVisualStudio ? this.windowsInfo.selectedVisualStudio.version : undefined;
       
    Apparently the user hard coded the defaultTarget to 11 which implies he's using Visual Studio 2012. Windows lib should be able to detect VS2012 installs, however the Titanium Mobile Windows platform is only compatible with Visual Studio 2013: https://github.com/appcelerator/titanium_mobile_windows/blob/master/package.json#L27. That explains why there were no Visual Studios found. If the user would run ti info, they would see that their environment is not supported.
  3. Praveen Innamuri 2015-11-24

    PRs are already merged to 5_1_X and master streams.
  4. Ewan Harris 2015-11-25

    Verified using: OS: Microsoft Windows 10 Pro Appc core: 5.1.0 Appc NPM: 4.2.2 Ti SDK: 5.1.1.GA Appc Studio: 4.4.0.201511241829 When Visual Studio is not installed, building for another platform no longer fails. Closing ticket

JSON Source