RMS 4.0 - MC40 crashes on Barcode.enable



I'm having problems using RMS 4.0 on Motorola MC40 (my first 4.0 project). I've got experience with RMS 2.2 and no such problems encountered there.


I'm writing simple app that will use scanner and use hardware trigger so I need to use Barcode.enable call.


In settings I will let the user choose scanner and on scanning page I want to enable choosen scanner.


Here is a part of scanning ruby view:



      scannerDevices = Barcode.enumerate()       app_info("Using scanner index: " + settings.Scanner + " scanners available: " + scannerDevices.length.to_s)       scannerObject = scannerDevices[settings.Scanner.to_i]       if !scannerObject.nil?         app_info("Setting default scanner to scanner index " + settings.Scanner)         Barcode.setDefault(scannerObject)         app_info("Default scanner set!")       end       app_info("Enabling scanner")       Barcode.enable(url_for(:action => :decodeRemoteLookup))       app_info("Barcode Enabled")


Now line 10 will crash the application, you can see the log output here:

RMS 4.0 MC40 crash dump

As you can see in the log the last line logged is "Enabling scanner" before crash.

settings.Scanner.to_i is either 0 or 1

decodeRemoteLookup view exists in the same controller.


It doesn't matter if I set default device to scanner 0 (Camera) or 1 (Imager) or event don't set it at all (it will use default scanner).


I've tried this both on Gingerbread and Jellybean and both of them crash.


I've never had such problems with Scanner module in 2.3.2 and I'm thinking of using older version of RMS to complete this project.


Any help on getting fixing this issue is appreciated.


Best Regards,

Krystian Sikora