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

Barcode.allowInstructions=false crashes the app after the second scan attempt (android) #13

Closed
antongorodezkiy opened this issue Mar 10, 2015 · 2 comments

Comments

@antongorodezkiy
Copy link

Hello friends,

First of all thank you for the library, it's very useful. And I was happy with it until I tried to set Barcode.allowInstructions = false;. First time it works great, instructions are not showing and the scanner works as expected. But after second scan attempt the app crashes with the following error.

Here is the stack trace (android):

[WARN] :   W/System.err: java.lang.NullPointerException
[WARN] :   W/System.err:    at ti.barcode.BarcodeModule.disableInstructions(BarcodeModule.java:317)
[WARN] :   W/System.err:    at ti.barcode.BarcodeModule.capture(BarcodeModule.java:297)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107)
[WARN] :   W/System.err:    at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347)
[WARN] :   W/System.err:    at android.os.Handler.dispatchMessage(Handler.java:98)
[WARN] :   W/System.err:    at android.os.Looper.loop(Looper.java:136)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
[ERROR] :  TiExceptionHandler: (main) [114,14624] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [1,14625] - In alloy/controllers/input/input.js:1,69
[ERROR] :  TiExceptionHandler: (main) [1,14626] - Message: Uncaught Error: Java Exception occurred
[ERROR] :  TiExceptionHandler: (main) [1,14627] - Source: lert("addEvList cancelButton"),t.add(i),alert("cancelButton add"),a.capture({a
[ERROR] :  V8Exception: Exception occurred at alloy/controllers/input/input.js:1: Uncaught Error: Java Exception occurred

Environment:
OS Ubuntu 14.04
Titanium Studio, build: 3.4.1.201410281727
Titanium SDK 3.5.0.GA
Ti.barcode 2.3.5
Tested on devices LG-D690 (android 4.4.2) and Samsung GT-S7562 (android 4.0.4).

Thank you in advance

@Widiyanto
Copy link

you must triying comment properties of barcode.
Example :
var Barcode = require('ti.barcode');
/Barcode.allowRotation = true;
Barcode.allowMenu = false;
Barcode.allowInstructions = false;
/
Barcode.capture({
animate: true,
//overlay: overlay,
/showCancel: true,
showRectangle: false,
keepOpen: false
/
});

that's work well

@hansemannn
Copy link
Contributor

Fixed in recent versions of the module. Closing.

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

No branches or pull requests

3 participants