Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 Files\PHP\v5.3;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Users\Filip\AppData\Local\Temp;C:\Python27;C:\Users\Filip\AppData\Roaming\npm;E:\dev\adt-bundle\sdk\platform-tools;E:\dev\adt-bundle\sdk\tools;E:\dev\WinAnt\bin;C:\Windows\Microsoft.NET\Framework\v4.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:\Windows\Microsoft.NET\Framework\v4.0.30319).
]

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

like image 817
Filip Avatar asked Jan 12 '23 23:01

Filip


2 Answers

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.

like image 99
Witriol Avatar answered Jan 20 '23 03:01

Witriol


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);
like image 24
LanderV Avatar answered Jan 20 '23 04:01

LanderV