Vuforia AR Camera working from the second attempt on Android - unity3d

I have an Android application which I created using Unity and C#, it also uses Vuforia. I have an AR Camera, which shows a black screen when I have just installed the application and gave camera permission to it, but when I close the app and start it again, everything works fine. I did a lot of searches, so what I found and tried- to Switch automatic graphics to OpenGls2, to set minimization to none, etc. Upgrading Vuforia version will not work for me. Also ARCamera works for phones supporting ARCore and does not work for phones not having ARCore. So I guess, the issue is within the architecture of the phone. Any ideas on how to make it work?

It must be related to camera API. I don't know how Vuforia is trying to initialize the camera. Seems like it tries to initialize it before successful permission result on old Android versions. You can delay Vuforia initialization to be after the permission check. There is an option to set Vuforia delayed initialization, but it would be better to make a preload scene where you do check all permissions and maybe other setup and then load the scene where Vuforia is used.
Update: Please try to update xr plugins for Unity (they are packages now), update Unity itself to the latest version. Do not use unity beta. Se if there are some recommendations from Vuforia of which unity version is the latest supported. Youc also try to create a new unity project from scratch and then import the latest vuforia, then try camera on android, then if all good, import all the resources for your app.

Related

How to switch mobile camera in Vuforia Engine Unity SDK v10.13?

I need help in switching mobile device camera in sdk Vuforia Engine Unity SDK v10.13 because vuforia has chnages the entire SDk. I did it past but i could find any documentation. Please help
I couldn't find any documention regarding camera switching in Vuforia Engine Unity SDK v10.13
Unfortunately switching btw back and front camera has been depracated but this can be achieved if its necessary via https://library.vuforia.com/platform-support/driver-framework.
If you need to sw btw the several back cameras that phones have, I don't believe its necessary as Vuforia usually selects the main camera and selecting any other camera like Telephoto or Ultrawide will results in tracking issues as the SDK was not designed to work with such images out of the box.
The Q that I would have, why do you need to sw? what do you want to achieve?

Hololens 1 does not detect air tap or other gestures in MRTK scene

I am currently working on developing an application for the Hololens 1 using Unity and MRTK.
I have been unable to get the air tap or any other input working in my application. The ring pointer for airtap does not appear in the application even though it works in the Unity Play Mode Input Simulation and other applications on the device. I tried it with the MRTK examples and even those did not work on the device.
Also I had to add the Tracked Pose Driver from the Player Settings to get the camera working properly but have not figured out how to get the application to accept gesture input.
Also tried the solution listed here: Why is 'air tap' gesture not working on HoloLens1 in my Unity/MRTK app?
but that did not work.
Will appreciate any guidance to solve this problem.
I finally got my project working after a lot of trying.
It turned out that initially, I had unknowingly configured the project to use XR SDK in Unity 2019 and thus had to configure MRTK accordingly. Thank you to Kevleigh for helping me with the issue here: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/7850
While this did work for my example project, I couldn't get the main project to work with the same settings even after installing all the plugins.
Finally, I had to switch to Unity 2018 and I got the project working with MRTK 2.3 and the default configuration. So, while Unity 2019 did not work for me you can get it working with XR SDK as suggested in the above link.

Is there a way I can test an Augmented Reality app on a phone that doesn't support ARCORE

I have a Xiaomi Redmi Note 8 Pro and it doesn't seem to support ARCore. I found some ways to dodge this but it appears to be quite complicated nor very safe.
My question is:
What other tools would you recommend if I want to create an app in Unity that also needs to use GPS modules, maybe altimeter and of course camera (AR stuff)?
I heard about Vuforia that might do the trick, also read something about AR Foundation from Unity. But to me, it looked like depending on chosen deployment it use AR Core or AR Kit(even Vuforia).
Any clearance about this maybe?
I suggest you don't try messing with your device. It doesn't support ARCore for good reason. And maybe you just try to use Android Studio Emulator, but Alas for some unknown reason, i try it but APK which is generated from unity can't be installed on the Emulator. Some stuff with the architecture
If you want to use Unity anyway. I suggest you use Vuforia. It works on most modern devices and doesn't even need device to test, just hit unity play mode and you can test around from your PC (need webcam).
Vuforia Engine provides a simulator mode in the Game view that you can activate by pressing the Play button. You can use this feature to evaluate and rapidly prototype your scene(s) without having to deploy to a device. (Source: https://library.vuforia.com/articles/Training/getting-started-with-vuforia-in-unity.html)
For Unity with ARFoundation, you can't use your PC like Unity with Vuforia, you need ARCore/ARKit supported devices.
Last if you want AR with GPS Modules (although this is not with unity) checkout AR.js https://github.com/AR-js-org/AR.js

Why the integration of Flutter with Unity and AR Vuforia makes no object appears?

I want to integrate Flutter app with Unity and AR Vuforia. I tried to use library: flutter_unity_widget (https://pub.dev/packages/flutter_unity_widget).
When integrating Flutter app with Unity without Vuforia it works very well. But when I tried to use it with Vuforia … OK, I didn't get any error and I could build app, but when I tested it, it didn't show any object.
I did all the configuration with the library tutorial.
Maybe some of you integrated something like that?
Do you have any sample project with it?
You can check out this blog about "Building with Flutter + Unity (AR Experience Toolkit)" for unity.
And for AR Vuforia, it seems that support for this is not yet materialized as of this GitHub post. You can watch out for the updates there.
The same thing happened to me when I was testing on iOS, Android was OK
I went through all the steps, only that Vuforia didn't recognize anything. According to this issue Dataset Foo could not be loaded and cannot be activated, I dragged and dropped the data folder and Vuforia into the Runner.
And everything was working fine

Unity3d 5.5 Enable Vr for Cardboard

I'm almost new to Unity3D, I've watched this presentation of Unity evengelist made in February 2016:
https://www.youtube.com/watch?v=pK0ZD53gOoE
Evengelist said and showed that to bring project to VR you need to select one checkbox (Virtual Reality Supported). Now in 5.5 version just downloaded, when I select Virtual Reality Supported it says also "you must add at least one VR SDK", also after that checkbox selected when I click play scene, I do not see two eyes screen, just ordinary view. When last year I tried to make VR for Cardboard and loaded Cardboard SDK, scene view showed two screens to each eye in play mode.
So the question - how now make VR that works on Cardboard in Unity3d? Do I still need Cardboard SDK (I don't need magnet input support or similar, just stereo and head movement support)?
Added: I don't have Cardboard SDK option in Unity somehow:
According to Unity Blog, Cardboard support is exclusive to Android only. iOS Cardboard support will be added soon.
Do I still need Cardboard SDK
I don't think you need the SDK. This is now Native support for Cardboard. Although,you can still download the Cardboard SDK and Unity will automatically use it.
And here is how to enable Cardboard SDK in Unity 5.5.
Thanks Programmer for your answer, it helped me find what my issue was. However, I've spent literally all of my time over the past few days trying to get Google Cardboard and Unity setup, so I figured I can at least post my answer too.
One problem I initially ran into was that I was trying to use GVR Unity SDK v1.1. There are several bugs in this version, so I reverted back to the GVR Unity SDK v1.0.3. This can be downloaded from the github repo: https://codeload.github.com/googlevr/gvr-unity-sdk/zip/f391c2436426857899af1c37f0720b3985631eb3
Then, I ran into multiple problems just getting things to run on android, so I found that I have to use build tools version 24.0.1. This can be downloaded using the Android SDK Manager executable.
Lastly, the "cardboard" option wasn't appearing for me as part of the drop downs, just like in the picture posted by the asker. The problem was that I was using a regular version of Unity, when I needed to actually be using the technical preview. This can be downloaded from https://unity3d.com/partners/google/daydream, and I'm running Unity v5.4.2f2-GVR13.
Then the drop down "cardboard" appeared, and I was able to follow google's official instructions (https://developers.google.com/vr/unity/get-started) and get things set up.
I ended up installing the Unity 5.6 Beta and got my Cardboard app built quite simply using the EasyMovieTexture store asset, turning on VR in Player Settings and adding Google Cardboard. It is working great in IOS and Android. I am working on turning off the Google Overlay as my app toggles between Cardboard and a simple 360 view and that is a proving a challenge. It seems from what I have read Google does not want you to turn off their overlay. I might try to do this natively on IOS.