我使用PhoneGap构建了一个简单的应用程序,并尝试使用以下代码打开条形码扫描器:
var scanCode = function() {
window.plugins.barcodeScanner.scan(
function(result) {
alert("Scanned Code: " + result.text
+ ". Format: " + result.format
+ ". Cancelled: " + result.cancelled);
}, function(error) {
alert("Scan failed: " + error);
});
}当我调用这个函数时,我得到一个错误:
Scan failed: No Activity found to handle Intent {act=com.phonegap.plugins.barcodescanner.SCAN cat=[android.category.DEFAULT]}我还注意到日志中有以下错误:
11-10 21:32:50.830: I/Database(1052): sqlite returned: error code = 14, msg = cannot open file at source line 25467我已经被这个问题困了好几个小时了。有人能给点建议吗?顺便说一句,我是用手机而不是模拟器来测试的。
发布于 2011-11-12 00:30:04
您是否至少使用了PhoneGap 1.1.0,您是否完全按照https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner中的描述更新了AndroidManifest.xml和res/xml/plugins.xml。
还有额外的分步说明here。
发布于 2012-06-02 01:15:24
我可以通过在AndroidManifest.xml文件中错误地将<activity> [barcode plug-in stuff] </activity>嵌套在应用程序的主要<activity> </activity>标记中来复制此错误。
发布于 2012-06-02 22:57:42
链接的网站上写着:
"android.intent.category.DEFAULT"您的错误代码为:
android.category.DEFAULT会是这样吗?
https://stackoverflow.com/questions/8089460
复制相似问题