Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Conflicts between AR camera & QR scanner

Discussion in 'Vuforia' started by areavisuale, Dec 21, 2017.

  1. areavisuale

    areavisuale

    Joined:
    Jul 23, 2015
    Posts:
    60
    I have problem with an application that worked before Vuforia was integrated in Unity 2017.2.

    This app consists in 2 scenes, 1 with a QR scanner (I used a plugin from the asset store: https://www.assetstore.unity3d.com/en/#!/content/56083), and another with a simple Augmented Reality scene with Vuforia.

    When I start the app, it crashes (on Android Samsung Galaxy S6) after the splashscreen. I tried to create another project (with the last Unity 2017.3) with these steps:

    1 - create new Unity 3D project
    2 - import updated QR asset
    3 - in player settings enable "Vuforia Augmented Reality support"
    4 - set the scan scene as first scene

    building the app with these steps I don't have crashes so...

    5 - create a new scene and import the ARcamera and ImageTarget gameobjects
    6 - put the scene in the build queue. I mantain the QR scanscene as primary scene, the AR is the secondone.

    now the app crash.

    Before 2017.2 there were some conflicts between AR & QR cameras, but the solution was to put the cameras in different scenes.

    This is the logcat of the error:

    --------- beginning of crash
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: FATAL EXCEPTION: EasyCamThread
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: Process: com.test.qrar, PID: 22883
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: java.lang.Error: FATAL EXCEPTION [EasyCamThread]
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: Unity version : 2017.3.0f3
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: Device model : samsung SM-G920F
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: Device fingerprint: samsung/zerofltexx/zeroflte:7.0/NRD90M/G920FXXU5EQK8:user/release-keys
    12-21 16:03:38.621 22883 22977 E AndroidRuntime:
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: Caused by: java.lang.RuntimeException: autoFocus failed
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: at android.hardware.Camera.native_autoFocus(Native Method)
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: at android.hardware.Camera.autoFocus(Camera.java:1297)
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: at com.ToolBar.EasyWebCam.EasyWebCam$5.run(EasyWebCam.java:206)
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
    12-21 16:03:38.621 22883 22977 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)
     
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Hello @areavisuale

    I answered your thread over on the Vuforia developer forums. Could you check that post and let me know if it resolves your issue?

    Thanks