如何配置插件"cordova-plugin-screen-orientation";在config.xml中 [英] How to configure plugin "cordova-plugin-screen-orientation" in config.xml

查看:370
本文介绍了如何配置插件"cordova-plugin-screen-orientation";在config.xml中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cordova plugin add cordova-plugin-screen-orientation

在使用上面的行提取了插件 cordova-plugin-screen-orientation 后,我在config.xml中查看了内容,但找不到类似于该插件的类似行.

After I fetched the plugin cordova-plugin-screen-orientation with the line above I looked inside the config.xml and I couldn't find a similar line like below for the plugin.

<gap:plugin name="org.apache.cordova.media-capture" />

我已经尝试过

  • 猜测插件的ID/名称(PhoneGap Build一直在说插件不受支持):
    <gap:plugin name="org.apache.cordova.screen-orientation" />
    <gap:plugin name="cordova-plugin-screen-orientation" />

最后一行是来自plugins.xml插件的插件ID/名称.

The last line is the plugin id/name from the plugins plugin.xml.

  • 在以下站点上找到插件ID/名称:

  • to find the plugin id/name on the sites below:

  • build.phonegap.com/plugins
  • plugins.telerik.com/cordova
  • cordova.apache.org/plugins
  • 配置插件phonegap
  • 将插件添加到phonegap
<gap:plugin name="cordova-plugin-screen-orientation" src="npm" />`

有人可以告诉我插件ID/名称或如何在config.xml中配置插件吗?

Can someone tell me the plugin id/name or how to configure the plugin in the config.xml?

推荐答案

该解决方案是将src="npm"替换为source="npm".

The solution is replacing src="npm" with source="npm".

<gap:plugin name="cordova-plugin-screen-orientation" source="npm" version="1.4.0" />

要转到 https://github.com/bau720123 ,即可为我提供此问题的解决方案在GitHub上创建.该问题已删除,因此我无法发布链接.

Credits go to https://github.com/bau720123 for giving me the solution in the issue I created on GitHub. The issue is deleted so I can't post a link to it.

有关如何在config.xml中配置插件的更多信息,请转到此处: http://docs.phonegap.com/phonegap-build/configuring/plugins/

For more info on how to configure a plugin in the config.xml go here: http://docs.phonegap.com/phonegap-build/configuring/plugins/

这篇关于如何配置插件"cordova-plugin-screen-orientation";在config.xml中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆