Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
679 views
in Technique[技术] by (71.8m points)

node.js - Cordova platform add wp7 fails - msbuild error

I want to create crossplatform app powered by Cordova 3.1.0 which I've installed via Node.js. I've already installed Visual Studio 2012 and Windows Phone SDK 8 + updates. I've also added

My Path in environment variables looks:

C:Python33;C:Program FilesPHPv5.3;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesMicrosoft SQL Server110ToolsBinn;C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0;C:Program Files (x86)Windows Kits8.0Windows Performance Toolkit;C:Program Files (x86)Microsoft SQL Server110ToolsBinn;C:Program FilesMicrosoft SQL Server110DTSBinn;C:Program Files (x86)Microsoft SQL Server110ToolsBinnManagementStudio;C:Program Files (x86)Microsoft SQL Server110DTSBinn;C:Program FilesMicrosoftWeb Platform Installer;C:UsersFilipAppDataLocalTemp;C:Python27;C:UsersFilipAppDataRoaming
pm;E:devadt-bundlesdkplatform-tools;E:devadt-bundlesdkools;E:devWinAntin;C:WindowsMicrosoft.NETFrameworkv4.0.30319

I've created app via command:

cordova create d4m com.example.d4m Drupal4me

I've added Android platform:

cordova platform add android

And I can build some Android app. But there are some issues with Windows Phone 7 / WP 8... I'm trying:

cordova platform add wp7

and receive error:

Checking wp7 requirements...
[Error: Error while checking requirements: Please install the .NET Framwork v4.0
.30319 (in the latest windows phone SDK's).
Make sure the "msbuild" command in your path is pointing to  v4.0.30319 of msbui
ld as well (inside C:WindowsMicrosoft.NETFrameworkv4.0.30319).
]

I work at Windows 8.1 and have latest .net Framework installed. What can I do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had same problem and when I ran verbose on build ("phonegap -V local build wp7"), I've discovered that error was from this file:

[phonegap] Running ""C:UsersTom.cordovalibwpcordova3.1.0wp7incheck_reqs"" (output to follow)

specifically in 78.line

var msversion = output.match(/.NETsFramework,sversions4.0/);

which looked for English 'version', but msbuild was returning version in localized string (in this case czech word "verze" for version)

[Microsoft .NET Framework, verze 4.0.30319.34003]

so solution is to change change reg. expr. to accept any word (w*) between characters "," and "4":

var msversion = output.match(/.NETsFramework,sw*s4.0/);

After that phonegap builds project successfully.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...