Barcode scanning on iOS

  • I've been using the "BarCode Scanner" (zxing) app successfully via Intents on Android for years, and now we're looking for a way to scan barcodes in our Qt/QML (Qt Quick Controls 1) on iOS as well.

    I did look at this project,, but it seems to have some drawbacks:

    • QZXingLive didn't work for me when testing with Qt 5.7 and 5.8 (no camera view appears) on Android, works on Windows though (I haven't tried yet on iOS though...)
    • looks like it uses quite old zxing libs?

    Please correct me if I'm wrong. What would be your advice on how to enable barcode scanning in your Qt/QML app for iOS? We would just need to be able to open the camera, scan a barcode (typically simple 1d) and get back the result to do our search in our app-internal database.

    We've done some simple Qt to Objective-C integration (like including Firebase API) before, maybe using something like this would be preferable?


  • @TheCrowKaka Yes, we now have the same solution running on Windows desktop, Android and iOS, basicly using this method:

  • You shoud try to edit Manifest.xml file and set targetSdk to API 22 .

  • @luca , thanks.

    Now tested QZXingLive example on Android using Qt 5.7.0 and 5.8.0. Changed target sdk from api 23 to 22, but still get this error when starting the app:

    Starting remote process.E Zygote  : v2
    I SELinux : Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11
    W SELinux : Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0032
    E Zygote  : accessInfo : 0
    I libpersona: KNOX_SDCARD checking this for 10382
    I libpersona: KNOX_SDCARD not a persona
    W SELinux : SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=org.qtproject.example
    I art     : Late-enabling -Xcheck:jni
    D TimaKeyStoreProvider: TimaSignature is unavailable
    D ActivityThread: Added TimaKeyStore provider
    E File    : fail readDirectory() errno=2
    E Qt      : Can't create main activity
    E Qt      : --Added-by-androiddeployqt--/qml/QtQuick/Controls.2/designer/BusyIndicatorSpecifics.qml
    E Qt      : 	at android.content.res.AssetManager.openAsset(Native Method)
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at
    E Qt      : 	at$1100(
    E Qt      : 	at$H.handleMessage(
    E Qt      : 	at android.os.Handler.dispatchMessage(
    E Qt      : 	at android.os.Looper.loop(
    E Qt      : 	at
    E Qt      : 	at java.lang.reflect.Method.invoke(Native Method)
    E Qt      : 	at$
    E Qt      : 	at
    D ViewRootImpl: #1 mView =$DecorView{18e33cc I.E...... R.....ID 0,0-0,0}
    D SecWifiDisplayUtil: Metadata value : none
    I Adreno  : QUALCOMM build                   : d842ad3, Ia10634f51b
    I Adreno  : Build Date                       : 01/04/16
    I Adreno  : OpenGL ES Shader Compiler Version: XE031.06.00.05
    I Adreno  : Local Branch                     : mybranch17578993
    I Adreno  : Remote Branch                    : quic/LA.BF.2.1.2_rb1.7
    I Adreno  : Remote Branch                    : NONE
    I Adreno  : Reconstruct Branch               : NOTHING
    D libEGL  : eglInitialize EGLDisplay = 0xb2a907c4
    I OpenGLRenderer: Initialized EGL, version 1.4
    D ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
    W DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
    D libGLESv1: DTS_GLAPI : DTS is not allowed for Package : org.qtproject.example
    I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@4023417 time:343061117
    I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@4023417 time:343064851

  • I just tried on my Linux PC with Qt 5.8 for Android and QZXingLive build and run without problem.
    Try starting with a clean QZXing installation .

  • @tomaslov
    Did you solve this problem of Barcode scanning on IOS?
    If Yes, could you please share the solution?

  • Hi @TheCrowKaka! You can scan/generate barcodes, and QR codes on IOS using SCodes. It's based on recent C++ Zxing port. Check it out here.

  • @TheCrowKaka Yes, we now have the same solution running on Windows desktop, Android and iOS, basicly using this method: