Hi Everybody,
I think I just came across a peculiar bug in the Unity API when trying to turn on the flash torch.
On some Android devices it seems that Vuforia can't control the flash torch any more. Any calls from
CameraDevice.Instance.SetFlashTorchMode(true)
return "Toggle flash ON FAILED" in the console.
My guess is that it's related to Android 9.0, where the camera interface was changed. I say this because the call does not work on OnePlus 6T and Samsung Galaxy Note 8, both with Android Pie (9.0), but it works without issues on Nexus 5x and on a Samsung Galaxy S7, both with Android Oreo (8.0).
The problem is that I can't use native calls from CameraManager to turn on the torchlight because Vuforia has exclusive access to the camera. I really need this to work in my next projet across all the devices and I am pretty much stuck here. Maybe there is another way to do it with Vuforia, but I couldn't find it.
Does anybody have any suggestions?
Thanks,
Sabin
Hello,
Hello,
I'm wondering if this is related to ARCore as currently torch is not supported.
ADB logs will indicate if Vuforia is using ARCore:
$ adb logcat AR:D Unity:D *:S
Hi medabit,
Hi medabit,
You were right. After disabling ARCore on my Android 9 device, the torch works without issues.
The funny thing is that my Samsung S7 with Android 8 also has ARCore installed, but in the ADB log it is not activated by Vuforia Fusion.
Hello,
Hello,
Thanks for the response and sorry that I didn't get back to you sooner. Glad you found the solution on your own.
[quote=sabinSerban]
Solved it by setting the
Solved it by setting the following, before initializing Vuforia: