在MAC OSX上使用WP8平台构建Ionic应用程序时出错

时间:2015-12-26 22:23:27

标签: windows-phone-8 ionic-framework ionic

很高兴我使用“ionic build android”构建的Android .apk文件在Samsung Note手机上运行。

我想在不同的硬件上尝试使用相同的应用程序,这是我的诺基亚Lumia Windows Phone 8。

所以我首先添加了平台wp8并且进展顺利。

$ ionic platform add wp8
Updated the hooks directory to have execute permissions
WARNING: Applications for platform wp8 can not be built on this OS - darwin.
Adding wp8 project...
Running command: /Users/user01/.cordova/lib/npm_cache/cordova-wp8/3.8.2/package/bin/create /Users/user01/repos/myTabs/platforms/wp8 com.ionicframework.mytabs754813 myTabs
Creating Cordova Windows Project:
  App Name  : myTabs
  Namespace : com.ionicframework.mytabs754813
  Path      : /Users/user01/repos/myTabs/platforms/wp8
Copying necessary files to /Users/user01/repos/myTabs/platforms/wp8
Updating project files
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Installing "cordova-plugin-console" for wp8
Installing "cordova-plugin-device" for wp8
Installing "cordova-plugin-splashscreen" for wp8
Installing "cordova-plugin-statusbar" for wp8
Installing "cordova-plugin-whitelist" for wp8

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Installing "ionic-plugin-keyboard" for wp8
Saving platform to package.json file
A platform already exists - now updating the entry: android platform=android, version=undefined, locator=wp8

然而,当我运行“ionic build wp8”时出现错误。

$ ionic build wp8
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Running command: /Users/user01/repos/myTabs/platforms/wp8/cordova/build
ERROR: MSBuild tools not found
ERROR building one of the platforms: Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2

1 个答案:

答案 0 :(得分:1)

仔细查看日志:

  

警告:无法在此操作系统上构建平台wp8的应用程序 - darwin。

只能在Windows上构建wp8应用程序。当然,您可以使用Bootcamp,Parallels或任何其他虚拟机。

相关问题