I have for iOS successfully implemented the barcode plugin into my app.
Sadly it's not working on Android. I get the following error:
"Scanning failed: Class not found"
Link to my code: www.reformationzweinull.de/app/
Link to complete .zip: www.reformationzweinull.de/app/refo.zip
Can anyone find the reason for this?
Many thanks!
Sadly it's not working on Android. I get the following error:
"Scanning failed: Class not found"
Link to my code: www.reformationzweinull.de/app/
Link to complete .zip: www.reformationzweinull.de/app/refo.zip
Can anyone find the reason for this?
Many thanks!
- 8 Posts
- 1 Reply Like
Posted 6 years ago
John Weidner, Champion
- 435 Posts
- 80 Reply Likes
Are you using PhoneGap Build? If so, I don't think you are suppose to reference the barcodescanner.js file in your index.html. The build process should handle that for you. Try removing that script line from your index.html and rebuild.
- 8 Posts
- 1 Reply Like
John Weidner, Champion
- 435 Posts
- 80 Reply Likes
What Android device are you using for testing? Is there anything more to the error message? I had no problem using the plugin on a Samsung GS5.
- 8 Posts
- 1 Reply Like
- 8 Posts
- 1 Reply Like
Ok. solved. Only problem seemed to have been Hydration. Without Hydration no problem!
- 1 Post
- 0 Reply Likes
Can you give me the solved code for the barcode scanner please
John Weidner, Champion
- 435 Posts
- 80 Reply Likes
in your index.html
In your config.xml
<html>
<body>
<script>
function scan() {
cordova.plugins.barcodeScanner.scan(
function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
},
function (error) {
alert("Scanning failed: " + error);
}
);
}
</script>
<div onclick="scan()"> Scan </div>
</body>
</html>
In your config.xml
<gap:plugin name="com.phonegap.plugins.barcodescanner" />
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers
-
Plugins
- 1283 Conversations
- 38 Followers


