简体   繁体   English

Cordova Crosswalk插件不起作用(`cordova-plugin-crosswalk-webview`)

[英]Cordova Crosswalk plugin not working (`cordova-plugin-crosswalk-webview`)

I am supporting a legacy application which uses crosswalk ( https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview ) which has unfortunately been deprecated. 我正在支持使用人行横道( https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview )的旧版应用程序,但该应用程序已被弃用。

What we're seeing is that our styling is not coming through as expected. 我们看到的是我们的样式未达到预期的效果。 What Crosswalk is supposed to do is embed a chromium browser in the Cordova app so that all styling that occurs in the shimmed react application can target the Chromium browser. Crosswalk应该做的是在Cordova应用程序中嵌入铬浏览器,以便在匀场的React应用程序中出现的所有样式都可以针对Chromium浏览器。 This tells me that Crosswalk is not getting loaded correctly. 这告诉我,Crosswalk没有正确加载。

This is what I have in my config.xml file (as it pertains to Crosswalk): 这就是我的config.xml文件中的内容(因为它与Crosswalk有关):

<preference name="xwalkVersion" value="23+" />
<preference name="xwalkLiteVersion" value="xwalk_core_library_canary:17+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="embedded" />
<preference name="xwalkMultipleApk" value="false" />

 <plugin name="cordova-plugin-crosswalk-webview" spec="^2.4.0">
        <variable name="XWALK_VERSION" value="23+" />
        <variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+" />
        <variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect" />
        <variable name="XWALK_MODE" value="embedded" />
        <variable name="XWALK_MULTIPLEAPK" value="false" />
  </plugin>

The commands that I use to get it to run are the following: 我用来使其运行的命令如下:

cordova prepare and cordova run android (I've attempted to run this on a simulator and on a connected device and the result is the same; the styling is incorrect). cordova preparecordova run android (我试图在模拟器和连接的设备上运行它,结果是相同的;样式不正确)。

A couple of notes. 几个注意事项。 First, I am not sure what the difference is between the preferences and the variable names in the config file - the variable names are added in as shown above when I run cordova plugins add cordova-plugin-crosswalk-webview , but they do not appear to work unless the preferences are also specified (I am not sure why). 首先,我不确定首选项和配置文件中的变量名之间有什么区别-如上所示,当我运行cordova plugins add cordova-plugin-crosswalk-webview时,变量名是在其中cordova plugins add cordova-plugin-crosswalk-webview ,但它们不会出现除非也指定了首选项(否则我不知道为什么)。 Secondly, preference xwalkMultipleApk seems to be need to be set to false, OR, the armv7 apk needs to be used as there are architecture incompatibility issues with differing apk versions of Crosswalk. 其次,似乎需要将首选项xwalkMultipleApk设置为false,否则,由于不同的apk版本的Crosswalk存在架构不兼容性问题,因此需要使用armv7 apk。

Finally, to make sure that this build is completely clean and I run the latest config.xml file I run the following commands: 最后,为确保此版本完全干净,并运行最新的config.xml文件,请运行以下命令:

  • cordova clean

  • cordova platforms rm android

  • cordova prepare

  • cordova platforms add android

  • cordova run android

I am not an expert in cordova, so please let me know if my build steps are not in the right order, although they appear to be to me. 我不是cordova的专家,所以请告诉我我的构建步骤是否正确,尽管对我而言似乎是正确的。

Any help would be appreciated - my colleague and I have tried multiple approaches that are similar to the above without much success. 任何帮助将不胜感激-我和我的同事已经尝试了多种类似于上述方法的方法,但收效甚微。 If there is a newer, non-deprecated shim for a chromium browser that is an alternative to Crosswalk please let me know! 如果有用于Chrome浏览器的更新的,不推荐使用的垫片,它是Crosswalk的替代品,请告诉我! Thanks! 谢谢!

检查您的插件文件夹,看看是否已安装。

Place something in your JS that can verify the user-agent. 在您的JS中放置可以验证用户代理的内容。 It is hard to tell what is going on here otherwise. 否则很难说这是怎么回事。

What is the specific need for crosswalk? 人行横道的具体需求是什么? Are you supporting older Android devices? 您是否支持较旧的Android设备?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 添加cordova-plugin-crosswalk-webview后cordova崩溃 - cordova crashes after adding cordova-plugin-crosswalk-webview 建立Android应用程式时发生错误(cordova-plugin-crosswalk-webview) - Error with building android app (cordova-plugin-crosswalk-webview) 无法使用phonegap-plugin-push,cordova-plugin-crosswalk-webview和cordova-plugin-health来构建cordova android - unable to make cordova android build with phonegap-plugin-push, cordova-plugin-crosswalk-webview, and cordova-plugin-health 使用cordova-plugin-crosswalk-webview从JS调用本机Java代码 - Calling native java code from JS with cordova-plugin-crosswalk-webview Cordova Crosswalk插件-与Meteor 1.4.2.2结合使用不起作用 - Cordova Crosswalk plugin - usage with Meteor 1.4.2.2 not working 使用Crosswalk WebView插件构建Cordova应用程序时出错 - Error when building Cordova app using Crosswalk WebView plugin cordova-plugin-camera在Crosswalk Android上不起作用(在iOS上工作) - cordova-plugin-camera not working on Crosswalk Android (Works on iOS) 将Crosswalk插件添加到Cordova Android项目后构建错误 - Build error after adding Crosswalk plugin to a Cordova Android project Cordova Crosswalk插件失败,并显示“很遗憾,{appName}已停止。” - Cordova Crosswalk Plugin failing with “Unfortunately, {appName} has stopped.” 添加crosswalk插件后,cordova 8.0.0构建失败 - cordova 8.0.0 build failed after add crosswalk plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM