Ionic> = 2 Windows平台构建总是尝试使用任何CPU

时间:2017-07-10 05:48:39

标签: cordova ionic-framework uwp ionic3

我有一个Ionic应用程序,我刚刚在安装了Visual Studio 2017的Windows PC上添加了Window平台。

在遇到其他一些初始问题之后,我认为我已经达到了最后的障碍,那就是我在尝试构建时遇到以下错误(即运行离子cordova构建窗口)......

Building project: H:\dev\apps\mobileapps\myapp\trunk\platforms\windows\CordovaApp.Windows10.jsproj
    Configuration : debug
    Platform      : anycpu
    Patching 10 in prebuild event...
    Injected base.js reference to the /www/index.html
    Removing /(
    *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from
    /www/index.html
    Removing /(
    *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/
    from /www/index.html
    Creating library
    H:\dev\apps\mobileapps\myapp\trunk\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\debug\SQLite3.UWP\SQLite3.UWP.lib
    and object
    H:\dev\apps\mobileapps\myapp\trunk\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\debug\SQLite3.UWP\SQLite3.UWP.exp
    SQLite3.UWP.vcxproj ->
    H:\dev\apps\mobileapps\myapp\trunk\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\debug\SQLite3.UWP\SQLite3.UWP.dll
    SQLite3.UWP.vcxproj ->
    H:\dev\apps\mobileapps\myapp\trunk\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\debug\SQLite3.UWP\SQLite3.UWP.pdb
    (Partial PDB)
    C:\Program Files (x86)\Microsoft Visual
    Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportBefore\Microsoft.Cpp.VCLibs120Universal.targets(103,5):
    warning MSB3842: Project "CordovaApp.Windows10" depends upon SDK "Microsoft Universal CRT Debug Runtime
    v10.0.15063.0" which supports apps targeting "UAP 10.0". To verify whether "Microsoft Universal CRT Debug
    Runtime v10.0.15063.0" is compatible with "UAP 10.0.15063.0", contact the SDK author or see
    http://go.microsoft.com/fwlink/?LinkID=309181.
    [H:\dev\apps\mobileapps\myapp\trunk\platforms\windows\CordovaApp.Windows10.jsproj]
    C:\Program Files (x86)\Microsoft Visual
    Studio\2017\Enterprise\MSBuild\15.0\Microsoft.Common.targets\ImportBefore\Microsoft.Cpp.VCLibs120Universal.targets(103,5):
    error MSB3779: The processor architecture of the project being built "Any CPU" is not supported by the
    referenced SDK "Microsoft.UniversalCRT.Debug, Version=10.0.15063.0". Please consider changing the targeted
    processor architecture of your project (in Visual Studio this can be done through the Configuration Manager) to
    one of the architectures supported by the SDK: "x86, x64, ARM, ARM64".
    [H:\dev\apps\mobileapps\myapp\trunk\platforms\windows\CordovaApp.Windows10.jsproj]
    Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe: Command
    failed with exit code 1

解决方案和项目最初设置了“Any CPU”,但我已经进入并尝试将其设置为x86和ARM ..

enter image description here

我已经保存了所有,我可以在Visual Studio中构建解决方案,但是当我进行离子构建时,它总是在抱怨“任何cpu”。

有没有人知道为什么会这样,以及如何解决它?

提前致谢!

1 个答案:

答案 0 :(得分:2)

您使用什么命令来构建项目?

如果您只使用ionic cordova build windows,则应添加拱形标志:

ionic cordova build windows -- --arch="x64"