【问题标题】:Ionic cordova build windows throw *MSBUILD* errorIonic cordova 构建窗口抛出 *MSBUILD* 错误
【发布时间】:2019-04-03 06:35:13
【问题描述】:

当我运行ionic cordova build windows 时,它会抛出类似错误-

> cordova build windows ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise Building project: C:\Users\shail\Desktop\ionic-demo\ionic-4-windows\platforms\windows\CordovaApp.Windows10.jsproj Configuration : debug Platform : anycpu Buildflags : /p:AppxBundle=Never MSBuildTools : C:\Program Files (x86)\MSBuild\14.0\bin buildProject spawn: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild [ 'C:\\Users\\shail\\Desktop\\ionic-demo\\ionic-4-windows\\platforms\\windows\\CordovaApp.Windows10.jsproj', '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal', '/nologo', '/p:Configuration=debug', '/p:Platform=anycpu', '/p:AppxBundle=Never'] { stdio: 'inherit' } C:\Users\shail\Desktop\ionic-demo\ionic-4-windows\platforms\windows\CordovaApp.Windows10.jsproj(61,5): error MSB4019: The imported project "C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Microsoft.VisualStudio..Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild: Command failed with exit code 1

有没有人可以帮助解决这个问题。

ionic -v 是4.12.0 cordove -v 是9.0.0

安装平台 科尔多瓦平台列表 Installed platforms: android 8.0.0 windows 7.0.0

使用 Visual Studio 2017 企业版

【问题讨论】:

  • 你好,你把版本改成15.0后,如果还是不行,报错信息还是错误MSB4019: The importing project "xxx" was not found?最新的错误信息是什么?
  • 和构建窗口一样是调用msbuild工具来构建项目。您是否尝试过在 VS 中构建项目或在本地 vs2017 的开发人员命令提示符中使用 msbuild 命令,结果如何?我需要在本地构建 vs 或 msbuild 时抛出一些错误消息,以进一步找出问题的原因:) 任何更新请随时在此处分享。 !。
  • 也许您可以从this link 中的 Farhad_87 解决方案中获得一些帮助。如果有帮助,请给我反馈。

标签: visual-studio cordova msbuild visual-studio-2017 ionic4


【解决方案1】:

根据报错信息:你的msbuild工具的路径是 无效。

1.对于vs2017,你使用的msbuild应该是C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin而不是C:\Program Files (x86)\MSBuild\14.0\bin

2.另外,v14.0 适用于 vs2015 而 v15.0 适用于 vs2017,请将设置中的所有“v14.0”更改为“v15.0”并运行它。

【讨论】:

  • @ShaileshSingh 嗨,有什么更新吗?您是否检查过它是否可以在 VS IDE 中成功构建?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-11-26
  • 2020-05-02
  • 2016-07-04
  • 2023-03-04
  • 2019-08-01
  • 1970-01-01
  • 2018-04-18
相关资源
最近更新 更多