Cordova 3.1.0:找不到插件或不是CDVPlugin [英] Cordova 3.1.0: Plugin not found or is not a CDVPlugin
问题描述
我正在尝试建立我的第一个Cordova应用程式,而我无法使用外挂程式。
I'm trying to build my first Cordova app and I can't get a plugin to work.
我的应用程式是使用Cordova命令列介面建立,所以我以这种方式添加了相机插件:
My app was built using the Cordova command line interface, so I've added the Camera plugin this way:
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
我的config.xml看起来像这样:
My config.xml looks like this:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.dev.myapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>My App</name>
<description>
A sample Apache Cordova application
</description>
<author email="dev@callback.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<feature name="Camera">
<param name="ios-package" value="CDVCamera" />
</feature>
</widget>
我已经运行 cordova build
运行良好,但是当我在Xcode中构建项目时,它告诉我,第一个 CDVCamera.h,CDVCamera.m文件
缺失。当我运行 cordova插件添加
时,命令行界面是否应该正确放置这些文件?
I've run cordova build
and everything went fine, but when I build the project in Xcode it tells me first the CDVCamera.h, CDVCamera.m files
are missing. Isn't the command line interface supposed to place those files correctly when I run cordova plugin add
in the first place ?
即使我在项目中手动复制文件,项目也会运行,但是当我调用Camera函数时,会抛出以下错误:
Also even if I copy the files manually in my project, the project runs but when I call the Camera functions it throws the following error:
ERROR: Plugin 'Camera' not found, or is not a CDVPlugin
我知道我是新手,但我不知道我做错了什么?
I know I'm new to this, but I can't figure out what am i doing wrong ?
推荐答案
好的,所以似乎你必须添加所有的插件,你想创建建立之前。所有资源文件都正确定位。
Ok so it seems you have to add all the plugins you want before you create the built. All the resources files are correctly located then.
这篇关于Cordova 3.1.0:找不到插件或不是CDVPlugin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!