4 Replies Latest reply on Mar 25, 2014 2:25 PM by Glenn Sayer

    RMS 4.0 - MC40 crashes on Barcode.enable

    Krystian Sikora

      Hello,

       

      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

        • Re: RMS 4.0 - MC40 crashes on Barcode.enable
          Kutir Mobility

          Hi Krystian,

            RMS 4.0 made some syntax changes with Barcode API.

            Use "Rho::Barcode" instead of "Barcode"

            Please refer the link

                http://docs.rhomobile.com/api/barcode#mdisable

                http://docs.rhomobile.com/guide/barcode

           

          Visnupriya R

          Kutir Mobility

            • Re: Re: RMS 4.0 - MC40 crashes on Barcode.enable
              Krystian Sikora

              Some time has passed, I've been using the Scanner module in the meanwhile. Now few months later I'm trying again to use Barcode module and again will MC40 crash.

              Last code that I've tried is on beta 33 of RhoStudio 4.1

               

                  app_info("Enumerating scanner devices")
                  scannerDevices = Rho::Barcode.enumerate()
                  app_info("Enumerated scanner devices")
                  scannerObject = scannerDevices[1]
                  if !scannerObject.nil?
                    app_info("Enabling scanner")  
                    scannerObject.enable(url_for(:action => :decodeLoginScan))  
                    app_info("Barcode Enabled")
                  end  
              

               

              Last logs that I see are "Enabling scanner"

               

              After that I can see

              I/APP     (21808): I 03/21/2014 14:18:48:694 00005545          MotoBarcode| BarcodeFactory createApiObject
              I/APP     (21808): I 03/21/2014 14:18:48:695 00005545          MotoBarcode| BarcodeFactory createApiObject creating EMDKScanner
              I/APP     (21808): I 03/21/2014 14:18:48:758 00005545          MotoScanner| EMDKScanner Constructor
              I/APP     (21808): I 03/21/2014 14:18:48:760 00005545       RhoScannerInfo| RhoScannerInfo+
              I/APP     (21808): I 03/21/2014 14:18:48:763 00005545          MotoScanner| LABEL_TYPE_GS1_DATABAR added successfully
              I/APP     (21808): I 03/21/2014 14:18:48:763 00005545          MotoScanner| LABEL_TYPE_GS1_DATABAR_LIM added successfully
              I/APP     (21808): I 03/21/2014 14:18:48:764 00005545          MotoScanner| LABEL_TYPE_GS1_DATABAR_EXP added successfully
              I/APP     (21808): I 03/21/2014 14:18:48:765 00005545          MotoScanner| LABEL_TYPE_MACROPDF does not exist: 1
              I/APP     (21808): I 03/21/2014 14:18:48:765 00005545          MotoScanner| LABEL_TYPE_MACROMICROPDF does not exist: 1
              I/APP     (21808): I 03/21/2014 14:18:48:766 00005545          MotoScanner| LABEL_TYPE_RSS14 does not exist: 1
              I/APP     (21808): I 03/21/2014 14:18:48:766 00005545          MotoScanner| LABEL_TYPE_RSSLIM does not exist: 1
              I/APP     (21808): I 03/21/2014 14:18:48:766 00005545          MotoScanner| LABEL_TYPE_RSSEXP does not exist: 1
              I/APP     (21808): I 03/21/2014 14:18:48:767 00005545          MotoBarcode| BarcodeFactory createApiObject created EMDKScanner
              F/libc    (21808): Fatal signal 11 (SIGSEGV) at 0x00000025 (code=1), thread 21829 (dico.flightshop)
              I/APP     (21808): I 03/21/2014 14:18:48:771 00005530          MotoScanner| EMDKScanner.run+
              D/Scanner (21808): Scanner() SupportedScanners 3
              D/dalvikvm(21808): GC_FOR_ALLOC freed 434K, 7% free 12339K/13191K, paused 33ms, total 33ms
              I/dalvikvm-heap(21808): Grow heap (frag case) to 12.816MB for 721936-byte allocation
              I/DEBUG   (  119): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
              I/DEBUG   (  119): Build fingerprint: 'Android/MC40/MC40:4.1.1/01-4AJ11-J-0600-0007-00-M1-090513/:user/release-keys'
              I/DEBUG   (  119): pid: 21808, tid: 21829, name: dico.flightshop  >>> com.edico.flightshop <<<
              I/DEBUG   (  119): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000025
              I/DEBUG   (  119):     r0 0000001d  r1 52c24a68  r2 538ff3c8  r3 1868b094
              I/DEBUG   (  119):     r4 0000001d  r5 4df9cbd8  r6 538ff42c  r7 513e8e00
              I/DEBUG   (  119):     r8 538ff3c8  r9 50f25fb0  sl 52c24a68  fp 538ff634
              I/DEBUG   (  119):     ip 52f0acd0  sp 538ff258  lr 52c254c0  pc 52ca9fb4  cpsr 60000110
              

               

              I don't know why such simple thing will not work on MC40. Scanner module has always been working well for me.