Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Scan failed due to an error" error on iOS and Android #92

Closed
itsallrelative opened this issue Nov 10, 2016 · 6 comments
Closed

"Scan failed due to an error" error on iOS and Android #92

itsallrelative opened this issue Nov 10, 2016 · 6 comments

Comments

@itsallrelative
Copy link

itsallrelative commented Nov 10, 2016

Getting a generic error when trying to scan on both my iOS and Android versions of my ionic app. The error just says:

Here is the code I have implemented:

`$scope.scanBarcode = function () {
try {

		cloudSky.zBar.scan({
			drawSight: true,
			flash: "off"
		}, function (scanData) {

			$scope.amazonAPICall(scanData);

		}, function (err) {
			$ionicPopup.alert({
				title: 'Scan Error',
				template: err
			});
		});

	} catch (err) {

		$ionicPopup.alert({
			title: 'Something went wrong',
			template: 'Please try your scan again. ' + err
		});

	}
};`

The only other information I get is a small stacktrace from xcode:

2016-11-09 19:39:57.167419 Ninja Scan[4791:1389736] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2016-11-09 19:39:57.174636 Ninja Scan[4791:1389736] [MC] Reading from public effective user settings. 2016-11-09 19:39:57.242854 Ninja Scan[4791:1389736] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 1]

@dcousens
Copy link
Contributor

@itsallrelative have you tried the latest code in this repository?

@itsallrelative
Copy link
Author

itsallrelative commented Nov 10, 2016 via email

@dcousens
Copy link
Contributor

@itsallrelative this may be an issue external to this library.

But, just to be sure, could you play with

UIView *infoButton = [[[[[self.scanReader.view.subviews objectAtIndex:2] subviews] objectAtIndex:0] subviews] objectAtIndex:infoButtonIndex];
, try some hard-coded indices and see if your issue is reproduced consistently?

What happens on your Android application?

@dcousens
Copy link
Contributor

You might also want to try submitting this to the cordova team.

@itsallrelative
Copy link
Author

itsallrelative commented Nov 11, 2016

Figured out how to resolve by following this issue: #87

Had to do:

ionic plugin rm cordova-plugin-cszbar
ionic plugin add https://github.com/tjwoon/csZBar.git#master

@dcousens
Copy link
Contributor

Awesome, thanks @itsallrelative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants