gpt4 book ai didi

javascript - PhoneGap - 安装 cordova-plugin-wkwebview-engine-localhost 插件时遇到问题

转载 作者:行者123 更新时间:2023-11-30 20:05:24 24 4
gpt4 key购买 nike

我一直在做一个javascript项目,客户要求将它发布到AppStore。我们选择与 PhoneGap 合作,因为它为我们做了很多工作并且结果令人满意。然而,与仅在 Safari 上运行的应用程序相比,某些苹果设备上的性能较差。

在阅读了 UIWebView 及其弃用方式后,我决定试一试 WKWebView,希望它的性能至少会好一点。

我成功安装了 cordova-plugin-wkwebview-engine,这让我遇到了很多人遇到过的 XHR 问题。但是我通过这篇文章找到了解决方案 https://stackoverflow.com/a/42953116/10551718

我遇到的问题是,当我尝试复制这位先生所做的事情时,我在 PhoneGap 构建中遇到关于 cordova-plugin-wkwebview-engine-localhost 的错误,说它不能克隆 git 存储库。

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'

我的配置里有这个...

<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" />

如有任何帮助,我们将不胜感激!

最佳答案

我最终找到了一个替代插件 - https://github.com/ionic-team/cordova-plugin-ionic-webview

这安装没有问题,并正确地强制了 WKWebView,这导致性能大幅提升!

关于javascript - PhoneGap - 安装 cordova-plugin-wkwebview-engine-localhost 插件时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52986092/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com