Ionic switches to WKWebView as default for new apps


#1

Blog post:
https://blog.ionic.io/wkwebview-for-all-a-new-webview-for-ionic/

Documentation:
http://ionicframework.com/docs/wkwebview/

Who wants to be first, play with it and report back to us?


#2

Greetings.
Today I installed the WKWebView in my project following the provided instructions.
It worked for ios, though I had to add the following commands to the list:
npm install @angular/platform-server@4.4.3 --save
npm install ajv
However, after trying to run the project for android, I receive this error message:

× Running command - failed!
[ERROR] An error occurred while running cordova prepare (exit code 1):


        (truncated) ... teGit
        npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:204:12)
        npm WARN addRemoteGit     at emitTwo (events.js:106:13)
        npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
        npm WARN addRemoteGit     at maybeClose (internal/child_process.js:886:16)
        npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
        npm WARN addRemoteGit  node_modules/cordova-plugin-ionic-webview resetting remote
        C:\Users\HMG21_Cesar\AppData\Roaming\npm-cache\_git-remotes\git-github-com-node-modules-cordova-plugin-ionic-webview-git-147dc8b2
        because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
        npm WARN addRemoteGit
        npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:204:12)
        npm WARN addRemoteGit     at emitTwo (events.js:106:13)
        npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
        npm WARN addRemoteGit     at maybeClose (internal/child_process.js:886:16)
        npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
        npm WARN addRemoteGit   killed: false,
        npm WARN addRemoteGit   code: 1,
        npm WARN addRemoteGit   signal: null,
        npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' } [...]
 npm ERR! Host key verification failed.
        npm ERR! fatal: Could not read from remote repository.
        npm ERR!
        npm ERR! Please make sure you have the correct access rights
        npm ERR! and the repository exists.
        npm ERR!
        npm ERR!
        npm ERR! If you need help, you may report this error at:
        npm ERR!     <https://github.com/npm/npm/issues>

This is my ionic info:


 @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:

    Cordova CLI : 7.0.1

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.7.0

System:

    Android SDK Tools : 25.2.3
    Node              : v6.10.2
    npm               : 3.10.10
    OS                : Windows 10

Any ideas?


#3

Hm, that is unexpected.

As it has to do with npm and some paths, my suggestion would be this:
Uninstall your node, install nvm (or nvm-windows if you are on Windows), install a new node (which includes npm) with this, then install ionic and cordova again and try your command again. The problem should be gone.


#4

It worked!
I uninstalled and installed npm and ionic cordova in my windows environment.
I had to also uninstall and install the WKWebView directly from my windows environment.
Thanks!