[SOLVED] Problem running windows platform on Windows 10


#1

Hello Ionic-Team,
I’m on Windows 10 64bit and installed all necessary stuff (node, etc.).
Then I try to create a blank sample app with:

ionic start blank blank
cd blank
ionic platform windows
ionic build windows

All is fine.
But when I try to run it, I get the following error, upon activating the app:

ionic run windows
Running command: "C:\Program Files (x86)\nodejs\node.exe" "D:\Visual Studio\Projects\Cordova\blank\hooks\after_prepare\010_add_platform_class.js" "D:\Visual Studio\Projects\Cordova\blank"
    add to body class: platform-windows
    Running command: cmd "/s /c ""D:\Visual Studio\Projects\Cordova\blank\platforms\windows\cordova\run.bat"""
    MSBuildToolsPath: C:\Program Files (x86)\MSBuild\14.0\bin\
    Building project: D:\Visual Studio\Projects\Cordova\blank\platforms\windows\CordovaApp.Windows.jsproj
            Configuration : debug
            Platform      : anycpu
      CordovaApp.Windows -> D:\Visual Studio\Projects\Cordova\blank\platforms\windows\AppPackages\CordovaApp.Windows_0.0.1.0_anycpu_debug_Test\CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
      CordovaApp.Windows -> D:\Visual Studio\Projects\Cordova\blank\platforms\windows\AppPackages\CordovaApp.Windows_0.0.1.0_anycpu_debug.appxupload
      Your package has been successfully created.
    Building project: D:\Visual Studio\Projects\Cordova\blank\platforms\windows\CordovaApp.Phone.jsproj
            Configuration : debug
            Platform      : anycpu
      CordovaApp.Phone -> D:\Visual Studio\Projects\Cordova\blank\platforms\windows\AppPackages\CordovaApp.Phone_0.0.1.0_anycpu_debug_Test\CordovaApp.Phone_0.0.1.0_anycpu_debug.appx
      CordovaApp.Phone -> D:\Visual Studio\Projects\Cordova\blank\platforms\windows\AppPackages\CordovaApp.Phone_0.0.1.0_anycpu_debug.appxupload
      Your package has been successfully created.
    
    Deploying windows package to device:
    D:\Visual Studio\Projects\Cordova\blank\platforms\windows\AppPackages\CordovaApp.Windows_0.0.1.0_anycpu_debug_Test\CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
    Attempt to uninstall previous application version...
    Attempt to install application...
    Found package: D:\Visual Studio\Projects\Cordova\blank\platforms\windows\AppPackages\CordovaApp.Windows_0.0.1.0_anycpu_debug_Test\CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
    
    Installing app...
    Found dependency package(s):
    D:\Visual Studio\Projects\Cordova\blank\platforms\windows\AppPackages\CordovaApp.Windows_0.0.1.0_anycpu_debug_Test\Dependencies\Microsoft.WinJS.2.0.appx
    
    Success: Your app was successfully installed.
    Starting application...
    ActivateApplication:  com.ionicframework.blank675013_h35559jr9hy9m!com.ionicframework.blank675013
    Exception calling "ActivateApplication" with "4" argument(s): "The remote procedure call failed. (Exception from
    HRESULT: 0x800706BE)"
    At D:\Visual Studio\Projects\Cordova\blank\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:164 char:5
    +     $appActivator.ActivateApplication($applicationUserModelId,$null,[ ...
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : COMException

Same for the templated app.
What am I missing?

Marco


#2

Installing the Windows 10 SDK solved the problem.
I needed to install it separately from VS 2015.
And added

<preference name="windows-target-version" value="10.0" />

to the config.xml file,


#3

Also you need to have Visual Studio 2013… and make sure you’re NOT loading any cordova scripts like: <script type="text/javascript" src="cordova_plugins.js"></script>


#4

I don’t have VS2013 anymore (and it has never been installed on my machine). Is there a special dependency needed from VS2013?


#5

I had to jump through some fiery hoops to get it all installed on my machine. I wish I would have saved all the links to everything I installed. I think there’s a dependency for windows / cordova that is only available for VS2013. VS2015 absolutely does not work and you’ll get this same error even when you set the target version to 10. Start with VS2013 and search for a windows - cordova dependency. Then make sure that VS2013 is running when running the cordova build windows and cordova windows run CLI command


#6

Just for clarification: After installing Windows 10 SDK, everything is working fine for me.
So, on my new Win10 machine, VS2015 and Windows 10 SDK are installed. That’s enough.


#7

Visual Studio 2015 currently installs the Windows 10 SDK automatically. You will have to add the Tools for Apache Cordova support specifically though as they are not install by default.

Then you can create an ionic project at the command line as normal and then create new project from existing code in VS2015 to open it in the IDE. Build / Run etc seem to work fine for me.


#9

Adding this line alone solved my problem,
i’m suing VS 2015 didn’t have to install the Windows 10 SDK separately


#10

How can I add Icon and splashscreens for Windows 10


#11

In the finished build just look for the images folder and replace them with your own images. There will be a bunch of default ‘empty’ images for which you can override, just make sure you give them the same name and dimension (eg: 150x150 px)


#12

Hi,

I added the preference section
preference name=“SplashScreen” value="screen"
preference name=“SplashScreenDelay” value="3000"
preference name=“windows-target-version” value=“10.0”

But when I execute the run command, i am getting below error:
Running command: “D:\Program Files\nodejs\node.exe” D:\project\test\hooks\after_prepare\010_add_platform_class.js D:\project\test
add to body class: platform-windows
Building project: D:\project\test\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : anycpu
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\JavaScript\Microsoft.VisualStudio.JavaScript.UAP.targets(70,2): error : “10.0.10240.0” is not a supported value for TargetPlatformVersion. Please change it on the Project Property page. [D:\project\test\platforms\windows\CordovaApp.Windows10.jsproj]
ERROR running one or more of the platforms: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
You may not have the required environment or OS to run this project

Please advice.


#13

@mantriv Did you solve that problem? I’m getting the same message about an unsupported value for TargetPlatformVersion (with a cordova project).


#14

Hi Eisenberg,

Yes, I am able to resolve the issue with WIN 10 platform.
I tried building the solution using VS 2015 and before that, removed the win 10 project from the solution. Just keeping the Windows 8.1 and Win Phone 8.1 Project.

I have not modified anything in the config.xml like the preference name=“windows-target-version” value=“10.0”

Hope this helps.

Thanks


#15

Thanks for the quick reply, that works for me too, but the requirements were unfortunately to build for Windows 10. It works when the “www” folder is copied into a Cordova project created with Visual Studio, but I’d prefer that the project that cordova creates would work.


#16

Is there any tutorial showing how to build an ionic app for W10?

Thanks!


#17

https://taco.visualstudio.com/en-us/docs/tutorial-ionic/


#18

I have installed visual studio 2015 but i have the same problem to run windows, did you install windows 10 SDK standalone o visual studio 2015?


#19

Got same issue for me.

To solve this I have made 3 changes in the project which resulted in project running successfully.

Below are the changes

In config.xml add
<preference name="windows-target-version" value="10.0" />

In index.html file add in head tag
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">

In App.js file replace below line
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);

with

if (cordova.plugins.Keyboard.hideKeyboardAccessoryBar) {
    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}

You can have more information in below link
https://taco.visualstudio.com/en-us/docs/tutorial-ionic/#configWin10


#20

Hi there, I am using Ionic 2
I got this error:

Error The following component requires .NET Native compilation which is not available when targeting ‘Windows10’ and ‘AnyCPU’. Consider changing the targeted processor architecture to one of the following: ‘x86, x64, ARM’ (if you are using command line this could be done by adding ‘–archs’ parameter, for example: ‘cordova build windows --archs=x64’). C:\Users\endriazizi\Desktop\VIRGINAPP\virginrevolutionapp\platforms\windows\plugins\pushwoosh-cordova-plugin\PushSDK.winmd


#21

this is regarding .net framework … Install the latest .net framework it will resolve the problem.