Vuforia Augmented Reality. Black screen when accessing Android camera

I’m using Unity 4.5.3p2 and the Vuforia Augmented Reality Unity Extension SDK 3.0.9.

When I load a scene with the game object “AR Camera”, my screen goes black. All the UI elements appear normally. I use NGUI to create my GUI elements. My game runs fine on iOS (I tested run it on my iPod Touch). I disable both “Use 32-bit display buffer” and “Use 24-bit Depth Buffer” in the “Players Setting” for Android but this doesn’t fix the issue.

I test run my game on the “HTC One” and “Nexus 5”. Both devices experience this problem.

1 Like

Hi Khoa,

I’ve have the same problem and has taken me an age to fix. I’ve used the Daikon Forge UI and like you thought this was the issue.

In the end I’ve had to follow the Vuforia ‘Migration’ information to delete a number of files from the Unity project, then install 3.0.9 for Unity, delete any existing AR camera and then add in the AR prefab again.

I’ve been rushing to get this done, but I can’t remember if I also had to install the Video Player sample for Unity as well before I got the image from the camera to show - oh and you probably will have a Unity crash after trying to install 3.0.10 video playback sample but once you run Unity again you should be ok.

I’m using the latest Vuforia and Unity 4.5.2f1

2 Likes

I follow the tutorial at https://developer.vuforia.com/resources/dev-guide/migrating-your-unity-project and was able to fix the problem.
Thank you so much.

The above solutions didn’t work for me, but I discovered that rotating the screen would cause the camera to turn back on. I looked that the Android code that runs when the orientation changes, and used that to add a delayed function when my app first runs:

void Start() {

StartCoroutine(“DelayedAndroidScreenFix”);
}

IEnumeratorDelayedAndroidScreenFix() {
yieldreturnnewWaitForSeconds(1.0f);
Debug.Log (“DelayedAndroidScreenFix”);
SurfaceUtilities.OnSurfaceChanged(Screen.width, Screen.height);
}

3 Likes

I do not know if it is related or not but i have a black screen problem with vuforia and solved it with disabling the antialiasing :slight_smile:

Antialiasing changes my screen to black if i set it in script
like
QualitySettings.antiAliasing = 2; //etc. //do not use anti aliasing in android if you have Unity 4.x

I hope it solves your problem too.

i need solution to camera black screen…
please help me
:frowning:

mine was solved by reverting the OpenGL ES 3 back to OpenGL ES 2. Shame to revert but hey it worked! :slight_smile:

I will try your solution today.

Cheers, on the latest phones untick “Automatic API” and set it to OpenGL ES 2… worked for me.

I had a black screen upon running it in Unity editor too.

Double-checking:
In Vuforia Configuration -
Make sure you have Enable Video Background checked. Hope that helps!

1 Like

Hi check in VuforiaonConfiguration what camera device you are using. make sure you see your webcam and make sure your webcam is working correctly.
Fixed it for me.

Still getting the black screen after all the changes. I will try to reinstall vuforia plugin

My bad for necro-ing but I had this issue and this page came up on google, for anyone else searching this issue here’s what solved it for me:

If you’re getting a black/grey screen on mobile, turn off anti aliasing on quality settings:
Edit → Project Settings → Quality

Me too ,My android app wants to open the unity ar,i followed this article’ Embedded Unity within Android App’ Medium background is black.the arcamera dont work

I was having the same problem but even farther from figuring out what was going wrong. I then saw veit270’s post here (Getting Started | Vuforia Library) about the ARCamera working when it is the first scene after the Unity splash screen and try that. IT FINALLY WORKED! I then was able to create a work around for this problem by putting the ARCamera on the first scene and making a script do a DoNotDestroyOnLoad(ARCamera) for the ARCamera GameObject. I then can load my scene I want and the camera is NO LONGER BLACK. Make sure you make the ARCamera some kind of singleton so DoNotDestroyOnLoad(ARCamera) only gets called once or you will have multiple ARCameras in your scenes and funky things start happening.

Hi everyone, had the same problem solved by ticking the checkbox i.e. Enable Video Background which is found in Open Vuforia Configuration

Hi everyone, had the same problem solved by ticking the checkbox i.e. Enable Video Background which is found in Open Vuforia Configuration

1 Like

Vuforia UI text is not shown in my mobile it showd pink colour there is no text like this .

I also have this problem.

I tried all suggestions here:

  • Window → Vuforia Configuration → enabled “Enable video background”.
  • Edit → Project Settings → Player → Resolution and Presentation → disabled the check in “Use 32-bit Display Buffer”
  • Edit → Project Settings → Player → Resolution and Presentation → enabled the check in “Disable Depth and Stencil”
  • Edit → Project Settings → Quality → Rendering → changed “Anti Aliasing” option to “Disabled”.
  • Rotated the device.
  • There is only one Scene that is shown right after the Splash screen.
  • Updated to all most recent versions of Unity, Vuforia and Android SO, then repeated all the suggestions.

Other alternatives, like the one to change the OpenGL ES 3 back to OpenGL ES 2 I didn’t understand what to do, as people made the suggestion without telling where is the menu / window we must access to apply the change.

Note: I didn’t find the "Use 24-bit Depth Buffer” in the “Players Setting”. I suppose it changed to “Disable Depth and Stencil”.

But I still get black screen (AR Camera not working) when running in the Android device.

Objects associated to ImageTarget appear when playing in Unity Editor (via my laptop’s webcam), but when running the APK in my Android device, AR Camera seems to cease working and as far as I know is no longer detecting the marker when I pass it in front of both cameras (front and read).

But regular objects appear. I placed 1 image under the ImageTarget and 1 image in the main hierarchy - I can see the last one, but not the first one in the Android device.

Versions (all up-to-date):

  • Unity: 2018.2.7f1
  • Vuforia: 7.2.24
  • Android device: Huawei Honor Blue 8, model: FRD-L09
  • Android SO: 8.0 (EMUI 8.0), build number 8.0.0.521 (C432) (Official)
3 Likes

Found it:

  • Edit → Project Settings → Player → Other Settings.
  • Disabled the check in “Auto Graphics API”
  • In the list that appeared, with OpenGLE2 and OpenGLE3 options, removed the OpenGLE3 from the list to prevent any kind of “fallback” and left OpenGLE2 as the unique option.

Same as before. Works in Unity Editor, but not in Android (black screen, only non-ImageTarget objects appear).