ZXing.net on iOS via Unity3D: Attempting to JIT compile method

Aug 23, 2013 at 8:59 AM
Edited Aug 23, 2013 at 9:01 AM
Hi all,

I compiled the ZXing.net dll for Unity3D via Visual Studio 2012. When running inside Unity3D editor, everything works ok. But if I run it on an iOS device (iPhone4S) I receive the following exception:
Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) System.Threading.Interlocked:CompareExchange (System.Action`2<object, System.EventArgs>&,System.Action`2<object, System.EventArgs>,System.Action`2<object, System.EventArgs>)' while running with --aot-only.
 at ZXing.Common.DecodingOptions+ChangeNotifyDictionary`2[ZXing.DecodeHintType,System.Object].add_ValueChanged (System.Action`2 value) [0x00000] in <filename unknown>:0 
  at ZXing.Common.DecodingOptions..ctor () [0x00000] in <filename unknown>:0 
  at ZXing.BarcodeReaderGeneric`1[T].get_Options () [0x00000] in <filename unknown>:0 
  at ZXing.BarcodeReaderGeneric`1[T]..ctor (Reader reader, System.Func`4 createLuminanceSource, System.Func`2 createBinarizer, System.Func`5 createRGBLuminanceSource) [0x00000] in <filename unknown>:0 
  at ZXing.BarcodeReaderGeneric`1[T]..ctor (Reader reader, System.Func`4 createLuminanceSource, System.Func`2 createBinarizer) [0x00000] in <filename unknown>:0 
  at ZXing.BarcodeReader..ctor (Reader reader, System.Func`4 createLuminanceSource, System.Func`2 createBinarizer) [0x00000] in <filename unknown>:0 
  at ZXing.BarcodeReader..ctor () [0x00000] in <filename unknown>:0 
  at BarcodeCam.DecodeQR () [0x00000] in /Users/thomas/Projects/z/z-svn/z/trunk/unity-z/Assets/code/QRCode/BarcodeCam.cs:122 
What am I doing wrong or is ZXing.net for Unity not iOS-compatible?

Best regards,
Thomas

Here is my DecodeQR method:
void DecodeQR()
   {
      // create a reader with a custom luminance source
      var barcodeReader = new BarcodeReader {AutoRotate = false, TryHarder = false};

      while (true)
      {
         if (isQuit)
            break;

         try
         {
            // decode the current frame
            var result = barcodeReader.Decode(c, W, H);
            if (result != null)
            {
               LastResult = result.Text;
               shouldEncodeNow = true;
               print(result.Text);
           print (result.BarcodeFormat);
                        isQuit=true;
                    }
                    
            }

            // Sleep a little bit and set the signal to get the next frame
            Thread.Sleep(200);
            c = null;
         }
         catch
         {
         }
      }
        
   }
Coordinator
Aug 23, 2013 at 1:06 PM
Looks like an incompatibility with Mono for iOS.
I found some things about that in the internet:
http://stackoverflow.com/questions/5288709/how-to-compile-libraries-with-monotouch-getting-error-attempting-to-jit-compi
http://www.mail-archive.com/mono-bugs@lists.ximian.com/msg76752.html

It seems to me that the use of generics (like here with System.Action<>) isn't supported on iOS.
My main problem is that I doesn't own a development environment for iOS. I can't test it.
I need to find a way to compile the library in such a way that it doesn't use the JIT compiler.
Aug 23, 2013 at 8:00 PM
Thanks for the quick response!

Based on your tips I tried the following:
  1. Open MonoDevelop from Unity 4.1.5
  2. Create new libary project "zxing-aot"
  3. Add all ZXing.net Files
  4. Build All
    Result: 26 errors based on generics
Example:
error c:\projects\zero\zero-svn\trunk\zxing.net-src\lib\IBarcodeWriterGeneric.cs(43,43): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
for this line public interface IBarcodeWriterGeneric<out TOutput>

Maybe you can reproduce it with my scenario? It would be very kind of you to fix those errors. Or can you tell me how I can fix this?
Coordinator
Aug 23, 2013 at 8:20 PM
Can you give me the complete error list?
I will try to build an iOS-compatible version of the library.
But I don't know if I find enough freetime this weekend.

You can try the following to get a working built from the current source:
define a build constant "WindowsCE" or "WINDOWS_PHONE" in the project settings.
Perhaps that will help a little bit.
Aug 23, 2013 at 8:59 PM
It would be very cool to build an iOS-compatible version of the library! I will assist you as good as I can.

Here is the complete error list:
  1. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\IBarcodeWriterGeneric.cs(43,43): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  2. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\IBarcodeWriterGeneric.cs(43,43): Error CS1519: Ungültiges Token "out" in Klasse, Struktur oder Schnittstellenmemberdeklaration. (CS1519) (zxing-aot)
  3. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\IBarcodeWriterGeneric.cs(54,54): Error CS1519: Ungültiges Token ">" in Klasse, Struktur oder Schnittstellenmemberdeklaration. (CS1519) (zxing-aot)
  4. Line 29 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Action.cs(32,32): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  5. Line 37 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Action.cs(32,32): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  6. Line 47 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Action.cs(32,32): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  7. Line 59 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Action.cs(32,32): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  8. Line 37 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Action.cs(25,25): Error CS0101: Der Namespace "ZXing" enthält bereits eine Definition für "Action". (CS0101) (zxing-aot)
  9. Line 47 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Action.cs(25,25): Error CS0101: Der Namespace "ZXing" enthält bereits eine Definition für "Action". (CS0101) (zxing-aot)
  10. Line 59 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Action.cs(25,25): Error CS0101: Der Namespace "ZXing" enthält bereits eine Definition für "Action". (CS0101) (zxing-aot)
  11. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(33,33): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  12. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(44,44): Error CS1001: Bezeichner erwartet (CS1001) (zxing-aot)
  13. Line 33 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(33,33): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  14. Line 43 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(33,33): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  15. Line 55 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(33,33): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  16. Line 69 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(33,33): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  17. Line 33 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(33,33): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  18. Line 43 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(28,28): Error CS0101: Der Namespace "ZXing" enthält bereits eine Definition für "Func". (CS0101) (zxing-aot)
  19. Line 55 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(28,28): Error CS0101: Der Namespace "ZXing" enthält bereits eine Definition für "Func". (CS0101) (zxing-aot)
  20. Line 69 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\net2.0\Func.cs(28,28): Error CS0101: Der Namespace "ZXing" enthält bereits eine Definition für "Func". (CS0101) (zxing-aot)
  21. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\renderer\IBarcodeRenderer.cs(38,38): Error CS1031: Typ erwartet. (CS1031) (zxing-aot)
  22. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\renderer\IBarcodeRenderer.cs(38,38): Error CS1519: Ungültiges Token "out" in Klasse, Struktur oder Schnittstellenmemberdeklaration. (CS1519) (zxing-aot)
  23. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\renderer\IBarcodeRenderer.cs(49,49): Error CS1519: Ungültiges Token ">" in Klasse, Struktur oder Schnittstellenmemberdeklaration. (CS1519) (zxing-aot)
  24. Line 25 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\renderer\IBarcodeRenderer.cs(49,49): Error CS1519: Ungültiges Token ">" in Klasse, Struktur oder Schnittstellenmemberdeklaration. (CS1519) (zxing-aot)
  25. Line 26 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\xamarin\BitmapLuminanceSource.monoandroid.cs(17,17): Error CS0260: Ein partial-Modifizierer in der Deklaration des Typs "ZXing.BitmapLuminanceSource" fehlt. Es ist eine andere partielle Deklaration dieses Typs vorhanden. (CS0260) (zxing-aot)
  26. Line 26 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\xamarin\BitmapRenderer.monoandroid.cs(17,17): Error CS0101: Der Namespace "ZXing.Rendering" enthält bereits eine Definition für "BitmapRenderer". (CS0101) (zxing-aot)
  27. Line 11 in c:\projects\z\z-svn\trunk\zxing.net-src\lib\xamarin\BitmapRenderer.monotouch.cs(15,15): Error CS0101: Der Namespace "ZXing.Rendering" enthält bereits eine Definition für "BitmapRenderer". (CS0101) (zxing-aot)
I will also try the workaround with the build constants.
Coordinator
Aug 25, 2013 at 7:32 PM
You should do the following:
  • define the build constant WINDOWS_PHONE
  • remove the complete folder .net2.0 from the project
  • remove the complete folder xamarin from the project
  • remove the files
    ** BitmapLuminanceSource.cs
    ** BitmapLuminanceSource.Silverlight.cs
    ** BitmapSourceLuminanceSource.cs
    ** Renderer/BitmapRenderer.cs
    ** Renderer/WriteableBitmapRenderer.cs
    ** common/BitMatrix.Drawing.cs
    ** common/BitMatrix.Silverlight.cs
    ** client/result/optional/.
    ** silverlight/.
    ** presentation/.
I created the project with MonoDevelop 3.1.2. Target framework is Mono/.Net 3.5.
Defined symbols: UNITY;WINDOWS_PHONE
Compiles without errors now.
Aug 26, 2013 at 1:53 PM
Thanks to your tips I managed to get a AOT build without errors.
But now it crashes on the iPhone! Xcode says "EXC_BAD_ACCESS". In the Unity editor everything is working fine.

0x125d2dc: cmp r1, #4
0x125d2e0: blls 0x125d380 ; m_ZXing_PDF417_Internal_Detector_detect_bool_ZXing_Common_BitMatrix + 1064
0x125d2e4: ldr r1, [r0, #32]
0x125d2e8: mov r0, r1
0x125d2ec: ldr r1, [r1]
0x125d2f0: mov lr, pc
0x125d2f4: ldr pc, [r1, #56]
0x125d2f8: vmov s4, r0
0x125d2fc: vcvt.f64.f32d2, s4
0x125d300: vcvt.s32.f64s0, d2
0x125d304: vmov r0, s0
0x125d308: str r0, [r11, #8]
0x125d30c: ldr r0, [r11, #16]
0x125d310: ldr r1, [r0, #12]
0x125d314: cmp r1, #4
0x125d318: blls 0x125d380 ; m_ZXing_PDF417_Internal_Detector_detect_bool_ZXing_Common_BitMatrix + 1064
0x125d31c: ldr r1, [r0, #32]
0x125d320: mov r0, r1
0x125d324: ldr r1, [r1]
0x125d328: mov lr, pc
0x125d32c: ldr pc, [r1, #52]
0x125d330: vmov s4, r0
0x125d334: vcvt.f64.f32d2, s4
0x125d338: vcvt.s32.f64s0, d2
0x125d33c: vmov r6, s0
0x125d340: ldr r0, [r11, #84]
0x125d344: mov r1, r0
-> Thread 15: EXC_BAD_ACCESS 0x125d348: ldr lr, [r1]
0x125d34c: bl 0x11effdc ; m_ZXing_Common_BitMatrix_get_Height
0x125d350: cmp r6, r0
0x125d354: mov r0, #0
0x125d358: movlt r0, #1
0x125d35c: strb r0, [r11, #24]
0x125d360: cmp r0, #0
0x125d364: bne 0x125cfe0 ; m_ZXing_PDF417_Internal_Detector_detect_bool_ZXing_Common_BitMatrix + 136
0x125d368: str r10, [r11, #20]
0x125d36c: mov r0, r10
0x125d370: add sp, r11, #100
0x125d374: pop {r5, r6, r8, r10, r11}
Coordinator
Aug 26, 2013 at 1:57 PM
Please try to restrict the supported codes to QR codes (or something similar, it's only important, that PDF417 is deactivated).

var barcodeReader = new BarcodeReader {AutoRotate = false, TryHarder = false, PossibleFormats = new List<BarcodeFormat> { BarcodeFormat.QR_CODE}};
Aug 26, 2013 at 2:11 PM
Thanks for your fast response! I used your restriction to QR codes. Now it crashes somewhere else with EXC_BAD_ACCESS:

0x1211308: .long 0x00b803d8 ; unknown opcode
0x121130c: ldr r0, [pc, r0]
0x1211310: mov r1, #2
0x1211314: bl 0x1337a30 ; plt__jit_icall_mono_array_new_specific
0x1211318: mov r10, r0
0x121131c: ldr r0, [r0, #12]
0x1211320: cmp r0, #0
0x1211324: blls 0x1211450 ; m_ZXing_Common_ReedSolomon_ReedSolomonEncoder_buildGenerator_int + 592
0x1211328: mov r0, #1
0x121132c: str r0, [r10, #16]
0x1211330: ldr r0, [r6, #8]
0x1211334: str r0, [r11, #28]
0x1211338: sub r0, r4, #1
0x121133c: str r0, [r11, #24]
0x1211340: ldr r1, [r6, #8]
0x1211344: mov r0, r1
-> Thread 1: EXC_BAD_ACCESS 0x1211348: ldr lr, [r1]
0x121134c: bl 0x120eeac ; m_ZXing_Common_ReedSolomon_GenericGF_get_GeneratorBase
0x1211350: mov r1, r0
0x1211354: ldr r0, [r11, #24]
0x1211358: ldr r2, [r11, #28]
0x121135c: add r1, r0, r1
0x1211360: mov r0, r2
0x1211364: ldr lr, [r2]
0x1211368: bl 0x120eb8c ; m_3af
0x121136c: ldr r1, [r10, #12]
0x1211370: cmp r1, #1
0x1211374: blls 0x1211450 ; m_ZXing_Common_ReedSolomon_ReedSolomonEncoder_buildGenerator_int + 592
0x1211378: str r0, [r10, #20]
0x121137c: ldr r0, [pc] ; m_ZXing_Common_ReedSolomon_ReedSolomonEncoder_buildGenerator_int + 388
0x1211380: b 0x1211388 ; m_ZXing_Common_ReedSolomon_ReedSolomonEncoder_buildGenerator_int + 392
0x1211384: adcseq r0, r8, r12, lsl #24
0x1211388: ldr r0, [pc, r0]
0x121138c: bl 0x1337690 ; p_1
Coordinator
Aug 26, 2013 at 2:45 PM
That errors are caught if you use ZXing.Net on other platforms. Application should not crash. Mono on iOS has a different behaviour I think.
Until I have the time to look at the source code you should try a barcode like EAN or UPC. The Reed Solomon error correction is mainly used by
2D codes.
Coordinator
Aug 27, 2013 at 8:08 PM
Do you have a chance to give me sample picture which leads to the crash?
Aug 27, 2013 at 8:38 PM
Yes, sure. I uploaded the image here: http://s18.postimg.org/ykibvf5a1/Foto.jpg
Coordinator
Aug 28, 2013 at 8:45 AM
We have to go another way. The image works for me on different platforms. But I can't test it on iOS.
Do you have a chance to build some try-catch around the error?
I need a dump of the BitMatrix or the LuminanceSource at the time when the error occurs.
Additionally it would be helpful if you can add some debugging output in the method
ZXing.Common.ReedSolomon.ReedSolomonEncoder::buildGenerator
and dump the state of the members which are used in the method.
Sep 2, 2013 at 11:19 PM
I made the following changes to ZXing.Common.ReedSolomon.ReedSolomonEncoder::buildGenerator (marked with //DEBUG and I also added a quick and dirty try...catch):
      private GenericGFPoly buildGenerator(int degree)
      {
        try
        {            
        
         Debug.Log("degree="+degree); //DEBUG
         Debug.Log("cachedGenerators.Count="+cachedGenerators.Count); //DEBUG
            
         if (degree >= cachedGenerators.Count)
         {
            var lastGenerator = cachedGenerators[cachedGenerators.Count - 1];
            Debug.Log("lastGenerator="+lastGenerator); //DEBUG
            for (int d = cachedGenerators.Count; d <= degree; d++)
            {
               var nextGenerator = lastGenerator.multiply(new GenericGFPoly(field, new int[] { 1, field.exp(d - 1 + field.GeneratorBase) }));
               Debug.Log("nextGenerator="+nextGenerator); //DEBUG
               cachedGenerators.Add(nextGenerator);
               lastGenerator = nextGenerator;
            }
         }
                    
        }

        catch (Exception e)
        {
            Debug.Log("Exception caught."+ e.StackTrace);
        }   
         Debug.Log ("buildGenerator returning "+cachedGenerators[degree]); //DEBUG
         return cachedGenerators[degree];
      }
Debug.Log uses Unity3D's console logging. Now there is no more crash on the iOS device, BUT it also doesn't recognize the QR code. On my laptop within the Unity3D editor the QR code is decoded correctly.
The output is as follows (same output on iOS device AND laptop within Unity3D editor):
degree=10
cachedGenerators.Count=1
lastGenerator=1
nextGenerator=x + 1
nextGenerator=x^2 + a^25x + a
nextGenerator=x^3 + a^198x^2 + a^199x + a^3
nextGenerator=x^4 + a^75x^3 + a^249x^2 + a^78x + a^6
nextGenerator=x^5 + a^113x^4 + a^164x^3 + a^166x^2 + a^119x + a^10
nextGenerator=x^6 + a^166x^5 + x^4 + a^134x^3 + a^5x^2 + a^176x + a^15
nextGenerator=x^7 + a^87x^6 + a^229x^5 + a^146x^4 + a^149x^3 + a^238x^2 + a^102x + a^21
nextGenerator=x^8 + a^175x^7 + a^238x^6 + a^208x^5 + a^249x^4 + a^215x^3 + a^252x^2 + a^196x + a^28
nextGenerator=x^9 + a^95x^8 + a^246x^7 + a^137x^6 + a^231x^5 + a^235x^4 + a^149x^3 + a^11x^2 + a^123x + a^36
nextGenerator=x^10 + a^251x^9 + a^67x^8 + a^46x^7 + a^61x^6 + a^118x^5 + a^70x^4 + a^64x^3 + a^94x^2 + a^32x + a^45
buildGenerator returning x^10 + a^251x^9 + a^67x^8 + a^46x^7 + a^61x^6 + a^118x^5 + a^70x^4 + a^64x^3 + a^94x^2 + a^32x + a^45
Where can I get the dump of the BitMatrix or the LuminanceSource?
Sep 3, 2013 at 12:13 AM
I managed to get the QR code recognized even on the iOS device! Problem was the same like http://stackoverflow.com/questions/13576333/qr-decode-exceptions-using-zxing-net-in-unity?rq=1

I had to change the init of the WebCamTexture in Start() to
      camTexture = new WebCamTexture();
      camTexture.requestedHeight = Screen.height; // 480;
      camTexture.requestedWidth = Screen.width; //640;
Thank you for your great support Michael!
Coordinator
Sep 8, 2013 at 8:44 PM
Thanks for your information.
I changed the unity demo in the source code repository.
Feb 27, 2014 at 1:34 PM
Hi everyone,

I've read every post about iOS problems with the exact error of 'attempting to hit compile'.
I'm on Unity 4.2.2f1, set the requestedHeight/Width with screen dimensions, checked the 16px problem BUT i still got the JIT error.

The code failed on the "BarcodeReader _reader = new BarcodeReader();" with the exact same error on the first post of this topic.
Maybe it's the .NET limitation on iOs devices but i'm not really sure about this.

I've also seen the post : http://zxingnet.codeplex.com/discussions/527384 who related the same error on the same point BUT on 4.3.

Michael, do you any informations or any magical fix for this ? :)

Btw, the lib works nice on Android and on Win/Mac. It's a pleasure to work with !
Coordinator
Feb 28, 2014 at 8:16 PM
I need someone who can build a version of ZXing.Net without generics and test it on an iOS device. I don't have the chance to do some magic here. Sorry.
Feb 28, 2014 at 8:28 PM
In my experience WebCamTexture seems to be broken in Unity 4.2.2. I use Vuforia now for camera access in Unity.
Perhaps you should try Vuforia or upgrade to 4.3.4 an try the hopefully fixed WebCamTexture.
May 6, 2014 at 5:08 PM
It looks like i'm at the exact same point as others.
I'm using unity to compile into iOS. Seems to crash when we first enter the zxing library, or possibly when the thread is made.
I had read somewhere that it may be beneficial to remove the generics from the library to work around this issue.
Another note that I think the issue below may not be related to ZXing.NET but could just be related to threading. Although I'll admit, I thought we had done threads in the past with Unity and promised ourselves we wouldn't do it again.

Barcode`_mono_metadata_generic_class_equal:
0x1c8c1cc: push {r4, r5, r6, r7, lr}
0x1c8c1d0: add r7, sp, #0xc
0x1c8c1d4: push {r8, r10}
0x1c8c1d8: ldrb r3, [r1, #12]
0x1c8c1dc: ldrb r12, [r0, #12]
0x1c8c1e0: eor r3, r12, r3
0x1c8c1e4: mov r12, #0x0
0x1c8c1e8: tst r3, #0x1
0x1c8c1ec: bne 0x1c8c24c ; _mono_metadata_generic_class_equal + 128
0x1c8c1f0: mov r8, r1
0x1c8c1f4: mov r10, r0
0x1c8c1f8: ldr r4, [r1, #4]
0x1c8c1fc: mov r6, r2
0x1c8c200: ldr r5, [r0, #4]
0x1c8c204: ldr r1, [r8]
0x1c8c208: ldr r0, [r10]
0x1c8c20c: bl 0x1c8c088 ; mono_metadata_class_equal
0x1c8c210: mov r12, #0x0
0x1c8c214: cmp r0, #0x0
0x1c8c218: beq 0x1c8c24c ; _mono_metadata_generic_class_equal + 128
0x1c8c21c: mov r0, r5
0x1c8c220: mov r1, r4
0x1c8c224: mov r2, r6
0x1c8c228: bl 0x1c8c31c ; mono_generic_inst_equal_full
0x1c8c22c: mov r12, #0x0
0x1c8c230: cmp r0, #0x0
0x1c8c234: beq 0x1c8c24c ; _mono_metadata_generic_class_equal + 128
0x1c8c238: ldrb r12, [r8, #12]
0x1c8c23c: ldrb r0, [r10, #12]
0x1c8c240: eor r12, r0, r12
0x1c8c244: ubfx r12, r12, #0x1, #0x1
0x1c8c248: eor r12, r12, #0x1
0x1c8c24c: mov r0, r12
0x1c8c250: pop {r8, r10}
0x1c8c254: pop {r4, r5, r6, r7, pc}
May 12, 2014 at 7:25 PM
Hey I wanted to come back and update this what whatever info I could.
I'm still stuck at a wall but here's what I've done so far.

Took out the DLL and dropped the source into it.
It caused a lot of errors so I gradually started taking things out until Unity could compile it. Running it caused an exception with pdf something. So I only used BarcodeFormat.ALL_1D as a barcode hint.
This made it run without exceptions, but it wasn't scanning anything. Using the source, I started sprinkling some logs to make sure I was getting into ZXing and I was. I noted that it was using the multiformat reader.

I'm wondering if I may have taken out something important when gutting the source, but I haven't had the time to jump back to this project. I'm also curious if the pixel format is different on iOS and isn't what ZXing is expecting. When I drew the bitmaps onto the UI, it was grayish or white with transparency. However when I debugged to see the bufffers, they had various color data that seemed appropriate for what was in the image (I was wearing a blue shirt, they all had high blue for rgb value).