2013-01-14 50 views
2

我跟着tutorial here在我的Android项目中安装了phonegap插件。无法在Android中使用PhoneGap条形码扫描器插件

科尔多瓦(PhoneGap)的版本是2.3.0,我从this github link下载插件;

这里是我的代码,我尝试调用条码扫描器:

window.plugins.barcodeScanner.scan(success, 
    function(error) { 
     alert("scanning failed: " + error) 
    } 
); 

当我按下按钮来调用方法,我得到以下错误:

scanning failed : Class not found. 

我是什么做错了?

回答

1

行地址:

<plugin name="BarcodeScanner" value="com.phonegap.plugins.barcodescanner.BarcodeScanner"/> 

你RES/XML/config.xml文件。

+0

我相信我这样做了。 我还将以下权限添加到AndroidManifest.xml中:

-1

行添加到您RES/XML/config.xml文件:

<feature name="BarcodeScanner"><param name="android-package" value="com.phonegap.plugins.barcodescanner.BarcodeScanner" /></feature> 
+0

You忘了线... – lpapp

相关问题