Cordova platform add wp7 fails - msbuild error

后端 未结 4 717
死守一世寂寞
死守一世寂寞 2020-12-19 16:57

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.

相关标签:
4条回答
  • 2020-12-19 17:12

    I agree with Witriol

    had same issue with PhoneGap 3.3.0 and wp8, all i had to do was comment out the version check in this file: C:\Users\Lander.cordova\lib\wp\cordova\3.3.0\wp8\bin\check_reqs.js

    this was the troublemaker:

    var msversion = output.match(/Microsoft\s\(R\)\s+Build\sEngine\s[a-z]+\s4\.0\.30319/i);
    

    this one should work in non-english environments as well:

    var msversion = output.match(/.NET\sFramework\,\s\w*\s4.0.30319/i);
    
    0 讨论(0)
  • 2020-12-19 17:20

    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:\Users\Tom.cordova\lib\wp\cordova\3.1.0\wp7\bin\check_reqs"" (output to follow)

    specifically in 78.line

    var msversion = output.match(/.NET\sFramework\,\sversion\s4.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(/.NET\sFramework\,\s\w*\s4.0/);

    After that phonegap builds project successfully.

    0 讨论(0)
  • 2020-12-19 17:23

    the same with spanish because of Versión and not Version

    need to modify

    C:\Users\Roberto\.cordova\lib\wp\cordova\3.3.0\wp8\bin\check_reqs.js
    

    change line 84

    83    var msversion = output.match(/Microsoft\s\(R\)\s+Build\sEngine\s[a-z]+\s4\.0\.30319/i);
    84    if (!msversion) {
    

    with

    84    if (false) {
    

    and work

    0 讨论(0)
  • 2020-12-19 17:35

    just set the environment variable in system variable "PATH" C:\Windows\Microsoft.NET\Framework\v4.0.30319\;

    it happened do to msbuild was not found.

    after that restart cmd and type "msbuild -version" u will see version.

    0 讨论(0)
提交回复
热议问题