ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Creating and running a Windows 10 app with Ionic 2 RC

Open hoffmanjon opened this issue 10 years ago • 18 comments

I posted this issue earlier (#9174) however it was closed with a link to the Cordova documentation. I do not believe this is a Cordova issue because I am able to create and run a standard Cordova application based on the documentation that was linked to the old issue. I also asked this question in the Ionic forums, the link is here: ((https://forum.ionicframework.com/t/build-a-windows-10-app-with-ionic-2-rc/70139))

I am trying to create an iOS, Android and Windows 10 app using Ionic 2 RC (version 2.1.8) however I am unable to get the app to run on a Windows 10 machine. I know this issue also exists in version 2.1.7 but it was working properly in the beta versions of Ionic 2 (sorry I do not have the exact versions).

To recreate this issue, on a Windows 10 machine (I have Windows 10 build 1607) I run the following steps:

  • ionic start test --v2 - Create Appp
  • ionic platform add windows - Add Windows platform
  • <preference name="windows-target-version" value="10.0" /> - Add line to config.xml
  • ionic run windows - Attempt to run windows

I receive the following error:

Exception calling "ActivateApplication" with "4" argument(s): "The remote procedure call failed. (Exception from
HRESULT: 0x800706BE)"
At C:\Users\jhoffman\Documents\ionictest\test12\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:164 char:5

If I take the windows-target-version line out of the config.xml file and build a windows 8 application, it runs fine so the issue is specific to the Windows 10 builds.

If I build the project with the ionic build windows command, the project does build fine and I am able to run the installer to install the application however when I attempt to run the application it immediately crashes.

I am able to create a standard Cordova app with the following steps:

    • crodova create Hello hoffman.jon.Hello
    • cd Hello
    • cordova platform add windows –save
    • {added <preference name="windows-target-version" value="10.0" /> to the config.xml file }

When I ran the project with cordova run windows command, the project starts up fine and I see the Cordova “Device is Ready” screen

I am using: Cordova: 6.4.0 Ionic Framework: 2.0.0-rc.3 Ionic CLI: 2.1.8 Ionic App Lib: 2.1.4 OS: Windows 10 build 1607

If this is not a bug, and I am doing something wrong, please let me know. Any help would be appreciated.

hoffmanjon avatar Nov 21 '16 14:11 hoffmanjon

I have updated Ionic to: Ionic CLI: 2.1.12 Ionic App Lib: 2.1.7 and I have the same problem.

Not sure if I should update the forum post and this issue or if I should only update one. If I only need to update one, please let me know otherwise I will update both.

hoffmanjon avatar Nov 22 '16 14:11 hoffmanjon

Same here

thibautLedz avatar Nov 25 '16 19:11 thibautLedz

I don't know if it helps but i tried to open the cordova solution (platform\windows) in visual studio 2015 and ran it in debug mode.

I catched an error before app crash: polyfill.js (3,16552) SCRIPT-1: Unhandled exception at line 3, column 16552 in ms-appx-web: //PATH/www/build/polyfills.js 0x8000ffff - JavaScript runtime error: argument not optionnal

hard to debug more with a minified javascript...

thibautLedz avatar Nov 25 '16 20:11 thibautLedz

I think we are in the same case as: #9051

thibautLedz avatar Nov 25 '16 20:11 thibautLedz

I have been getting the same error, or if a I change the windows version in config.xml to a slightly different number then the app deploys onto an emulator, but only shows a white screen. Cordova CLI: 6.4.0
Ionic Framework Version: 2.0. Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7 Ionic App Scripts Version: 0. ios-deploy version: Not insta ios-sim version: Not installe OS: Windows 10
Node Version: v7.2.0
Xcode version: Not installed

Windows Version 1607 OS Build 14393.447

fahimshekaib avatar Nov 27 '16 15:11 fahimshekaib

I am not getting the polyfill.js error but I am creating the project from the ionic command line tools and not creating it within Visual Studios. I am not familiar with the internal workings of Ionic so my question is: Do these two issues sound like the same issue or two separate ones? The error I am getting is:

Exception calling "ActivateApplication" with "4" argument(s): "The remote procedure call failed. (Exception from HRESULT: 0x800706BE)" At C:\Users\jhoffman\Documents\ionictest\test12\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:164 char:5

I would prefer to create the project with the command line tools since I may be targeting Android first and then add the project to Visual Studios for the Windows development.

hoffmanjon avatar Nov 29 '16 12:11 hoffmanjon

I'm adding more details about this issue The bug is related to Edge and Polyfill.js compatibility. (Edge is the WebView for Win 10 desktop and mobile)

screenshot 2016-12-03 13 28 16

Edge version: Microsoft Edge 38.14393.0.0

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.46
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.1
Xcode version: Not installed

Can we hope a solution in next RC ?

thibautLedz avatar Dec 03 '16 12:12 thibautLedz

@hoffmanjon @thiboot guys, it seems that it's working with
"ionic-angular": "2.0.0-rc.3-201612081620", *from https://github.com/driftyco/ionic/issues/9051#issuecomment-263374859

demns avatar Dec 10 '16 07:12 demns

@demns what angular version are you using ? I tried with angular 2.2.x and 2.1.x with this ionic-angular build and I can still see the problem

almost92 avatar Dec 11 '16 20:12 almost92

@almost92
"dependencies": { "@angular/common": "2.2.1", "@angular/compiler": "2.2.1", "@angular/compiler-cli": "2.2.1", "@angular/core": "2.2.1", "@angular/forms": "2.2.1", "@angular/http": "2.2.1", "@angular/platform-browser": "2.2.1", "@angular/platform-browser-dynamic": "2.2.1", "@angular/platform-server": "2.2.1", "@ionic/storage": "1.1.6", "ionic-angular": "2.0.0-rc.3-201612081620", "ionic-native": "2.2.3", "ionicons": "3.0.0", "lodash": "^4.17.2", "rxjs": "5.0.0-beta.12", "zone.js": "0.6.26" }, "devDependencies": { "@ionic/app-scripts": "0.0.46", "typescript": "2.0.9" },

demns avatar Dec 11 '16 20:12 demns

I updated to the latest Ionic (npm -g install ionic) but my angular version is only showing up as version 2.1.1:

+-- @angular/[email protected] +-- @angular/[email protected] +-- @angular/[email protected]

Sorry for the basic question but how do I update to the 2.2.1 to test this?

hoffmanjon avatar Dec 12 '16 13:12 hoffmanjon

@hoffmanjon npm i --save @angular/[email protected] @angular/[email protected] @angular/[email protected] and so on

demns avatar Dec 12 '16 13:12 demns

Here are the steps I took:

And the application started correctly. AWESOME thank you for the help. At idea when angular 2.2.1 modules will be included with Ionic 2?

One other question, should I close the issue or wait for Ionic 2 to be updated?

hoffmanjon avatar Dec 12 '16 17:12 hoffmanjon

@jgw96 @brandyscarney looks resolved now, see comment from @hoffmanjon above :) *Thanks guys, keep pushing it!

demns avatar Dec 12 '16 21:12 demns

Thanks @demns! @hoffmanjon Angular 2.2.1 is in the latest nightly version and will officially be in the 2.0.0-rc.4 release: https://github.com/driftyco/ionic/blob/master/package.json#L28-L36

brandyscarney avatar Dec 12 '16 21:12 brandyscarney

@brandyscarney any plans to update Angular to 2.3.0 or to 2.2.4?

trakhimenok avatar Dec 13 '16 10:12 trakhimenok

This worked for me: "ionic-angular": "2.0.0-rc.3-201612081620" My ionic info: ordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.3-201612081620 Ionic CLI Version: 2.1.17 Ionic App Lib Version: 2.1.7 Ionic App Scripts Version: 0.0.36 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v6.9.1 Xcode version: Not installed

loursbourg avatar Dec 16 '16 16:12 loursbourg

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 05 '18 18:09 ionitron-bot[bot]