Log in or register to post comments

Conflicts between AR camera & QR scanner

December 21, 2017 - 9:38am #1

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)​

 

Any ideas??

Conflicts between AR camera & QR scanner

November 15, 2018 - 2:09am #3

Hello, I am also having the same problem. The thing is that QR works when I check "Delayed Initialization" but AR Camera is not working because in the ARScene's Vuforia Configuration, Delayed Initialization also check and that causes the problem. My question is how can I access to that variable and uncheck it via script. I have found something like this : VuforiaAbstractConfiguration.Instance.Vuforia.DelayedInitialization = false; but I dont know how to make it I could not found VuforiaAbstractConfiguration. I would be much appreciate it if you can help me with this. ( btw I am using latest version of Vuforia )

Conflicts between AR camera & QR scanner

December 21, 2017 - 10:25am #2

Hello areavisuale,

In 2017.2 and 2017.3 Vuforia is automatically active in all scenes unless explicitly disabled. This is being addressed in a future release, but for now there is a work around you'll need to implement.

In your scene that you do not want Vuforia active, add an ARCamera and disable the VuforiaBehaviour active on it. This will ensure Vuforia is not active in this scene. You may also want to check "Delayed Initialization" within the Vuforia Configuration if you aren't using Vuforia in your first scene.

Thanks,

Vuforia Support

Log in or register to post comments