简体   繁体   中英

PhoneGap - Trouble installing cordova-plugin-wkwebview-engine-localhost plugin

I have been working on a javascript project, the client requires it to be published to the AppStore. We chose to work with PhoneGap as it did a lot of the work for us and the results were satisfactory. However the performance on some apple devices was a poor compared to the application running just on Safari.

After doing some reading into UIWebView and how its deprecated, I decided to give the WKWebView a go hoping that the performance would be at least a little better.

I successfully installed the cordova-plugin-wkwebview-engine which then led me to the XHR issues that I have seen many people having. However I found a solution via this post https://stackoverflow.com/a/42953116/10551718

The issue I am having is when I try and replicate what this gentleman has done, I get errors in the PhoneGap build regarding cordova-plugin-wkwebview-engine-localhost saying that it can't clone the git repository.

Build Date: 2018-10-24 04:20:25 -0700
--------------------------------------------------------------------------------
PLUGIN OUTPUT
--------------------------------------------------------------------------------
Fetching plugin "cordova-plugin-splashscreen" via npm
Installing "cordova-plugin-splashscreen" at "5.0.2" for ios
Fetching plugin "cordova-plugin-wkwebview-engine" via npm
Installing "cordova-plugin-wkwebview-engine" at "1.1.4" for ios
"plugman-151 install --platform ios --project /project --plugin https://github.com/apache/cordova-plugins.git#wkwebview-engine-localhost --nohooks=.": Fetching plugin "https://github.com/apache/cordova-plugins.git" via git clone
Using shallow clone
Repository "https://github.com/apache/cordova-plugins.git" checked out to git ref "wkwebview-engine-localhost" at "a3cc931".
Installing "cordova-labs-wkwebview-engine-localhost" at "0.5.1" for ios
Fetching plugin "git+https://github.com/apache/cordova-plugins.git" via git clone
Cloning full repository
Failed to install 'cordova-labs-wkwebview-engine-localhost': Error
at /.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/pgb-cordova-lib/src/plugman/fetch.js:100:37
at _rejected (/.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/cordova-common/node_modules/q/q.js:864:24)
at /.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/cordova-common/node_modules/q/q.js:890:30
at Promise.when (/.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/cordova-common/node_modules/q/q.js:1142:31)
at Promise.promise.promiseDispatch (/.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/cordova-common/node_modules/q/q.js:808:41)
at /.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/cordova-common/node_modules/q/q.js:624:44
at runSingle (/.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/cordova-common/node_modules/q/q.js:137:13)
at flush (/.nvm/versions/node/v8.1.4/lib/node_modules/pgb-plugman-151/node_modules/cordova-common/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:95:7)
at process._tickCallback (internal/process/next_tick.js:161:9)
Failed to fetch plugin git+https://github.com/apache/cordova-plugins.git via git.
Either there is a connection problems, or plugin spec is incorrect:
Error: git: Command failed with exit code 128 Error output:
Cloning into '/var/folders/lt/xxbrk07x45bdj1fl3wjgf8yc0000gn/T/git/1540380025411'...
fatal: Unable to find remote helper for 'git+https'

I have this in my config...

<plugin name="cordova-plugin-splashscreen" source="npm" />
<plugin name="cordova-plugin-wkwebview-engine" source="npm" />
<plugin name="cordova-plugin-wkwebview-engine-localhost" spec="https://github.com/apache/cordova-plugins.git#wkwebview-engine-localhost" />

<content src="http://localhost" />

<feature name="CDVWKWebViewEngine">
    <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>

<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

Any help would be greatly appreciated!

I ended up finding an alternative plugin - https://github.com/ionic-team/cordova-plugin-ionic-webview

This installed with no issues and correctly forced the WKWebView which lead to a massive performance increase!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM