Cordova插件手动安装 [英] Cordova plugins manual installation

查看:371
本文介绍了Cordova插件手动安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我的Phonegap应用上安装此插件,但是对象 window.tlantic.plugins.socket 似乎没有被证实.我认为这是因为当我尝试使用

i tried to install this plugin on my Phonegap app, but the object window.tlantic.plugins.socket seems not to be istantiated. I think it's because when i try to install that plugin with

cordova插件添加com.tlantic.plugins.socket

cordova plugin add com.tlantic.plugins.socket

找不到它,所以我必须使用整个URL

it can't find it, so i have to use the entire url

cordova插件添加 https://github.com/Tlantic/cdv-socket-plugin/

并且安装有效,但插件无效.如果我从build.phonegap.com构建它,则返回

and the installation works but not the plugin. If i build it from build.phonegap.com it returns

错误-以下插件,插件版本或该插件的依赖项不在npm上:com.tlantic.plugins.socket@1

Error - The following plugin, plugin version or a dependancy of this plugin is not on npm: com.tlantic.plugins.socket@1

我只是尝试手动安装它,从github仓库中获取文件,但是我无法以任何方式使其工作..能否给我一些有关如何在phonegap/cordova应用程序中手动安装插件的信息?非常感谢.

I just tried to install it manually, taking files from the github repository, but i can't make it work in any ways..could you give me some info on how to install manually a plugin in phonegap/cordova applications? Thank you very much.

推荐答案

  1. 从github下载插件.

  1. Download Plugin from the github.

将源文件添加到您的项目

Add source files to your project

更改config.xml和androidmanifest.xml文件(以下载的plugin文件夹中的plugin.xml文件为参考).

change config.xml and androidmanifest.xml file(take the reference of plugin.xml file in downloaded plugin folder).

在您的www文件夹中添加插件js代码,并在html文件中提供引用.

Add plugin js code in your www folder and give the reference in html file.

希望对您有帮助

这篇关于Cordova插件手动安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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