2013-01-14 52 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

相關問題