Search Unity

Vuforia Augmented Reality. Black screen when accessing Android camera.

Discussion in 'Android' started by Khoa94, Aug 29, 2014.

  1. Khoa94

    Khoa94

    Joined:
    May 27, 2014
    Posts:
    13
    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.
     
    Voker201 likes this.
  2. Quicksilver01uk

    Quicksilver01uk

    Joined:
    May 12, 2013
    Posts:
    13
    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
     
    Darshank and Khoa94 like this.
  3. Khoa94

    Khoa94

    Joined:
    May 27, 2014
    Posts:
    13
  4. scott5678

    scott5678

    Joined:
    May 15, 2013
    Posts:
    13
    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);
    }
     
    AM-Dev, D3m0n and VictorPinto90 like this.
  5. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    91
    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 :)

    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.
     
  6. arjosarila

    arjosarila

    Joined:
    Jun 20, 2015
    Posts:
    1
    i need solution to camera black screen....
    please help me
    :(
     
  7. mtullock

    mtullock

    Joined:
    Feb 26, 2015
    Posts:
    3
    mine was solved by reverting the OpenGL ES 3 back to OpenGL ES 2. Shame to revert but hey it worked! :)
     
  8. VictorPinto90

    VictorPinto90

    Joined:
    Jul 31, 2013
    Posts:
    2
    I will try your solution today.
     
  9. srmojuze

    srmojuze

    Joined:
    Mar 18, 2013
    Posts:
    127
    Cheers, on the latest phones untick "Automatic API" and set it to OpenGL ES 2... worked for me.
     
  10. thedarcsage

    thedarcsage

    Joined:
    Nov 2, 2016
    Posts:
    23
    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!
     
    hereisfahad likes this.
  11. black-widow777

    black-widow777

    Joined:
    Oct 8, 2016
    Posts:
    4
    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.
     
  12. youndivian

    youndivian

    Joined:
    Nov 15, 2014
    Posts:
    1
    Still getting the black screen after all the changes. I will try to reinstall vuforia plugin
     
  13. TomSantoro

    TomSantoro

    Joined:
    Oct 17, 2015
    Posts:
    9
    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
     
  14. James0525

    James0525

    Joined:
    May 4, 2018
    Posts:
    1
  15. AlexanderEhlert

    AlexanderEhlert

    Joined:
    Jun 3, 2018
    Posts:
    2
    I was having the same problem but even farther from figuring out what was going wrong. I then saw veit270's post here (https://developer.vuforia.com/forum...k-screen-after-loading-ar-scene#comment-64407) 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.
     
  16. rola12

    rola12

    Joined:
    Nov 8, 2016
    Posts:
    5
    Hi everyone, had the same problem solved by ticking the checkbox i.e. Enable Video Background which is found in Open Vuforia Configuration
     
  17. rola12

    rola12

    Joined:
    Nov 8, 2016
    Posts:
    5
    Hi everyone, had the same problem solved by ticking the checkbox i.e. Enable Video Background which is found in Open Vuforia Configuration
     
    tanatos98765 likes this.
  18. praveenafelix123

    praveenafelix123

    Joined:
    Aug 6, 2018
    Posts:
    1
    Vuforia UI text is not shown in my mobile it showd pink colour there is no text like this . Screenshot_2018-09-03-16-52-38-13.png Screenshot_2018-09-03-16-52-38-13.png
     
  19. rmpinheiro

    rmpinheiro

    Joined:
    Apr 28, 2018
    Posts:
    2
    I also have this problem.

    I tried all suggestions here:
    1. Window -> Vuforia Configuration -> enabled "Enable video background".
    2. Edit -> Project Settings -> Player -> Resolution and Presentation -> disabled the check in "Use 32-bit Display Buffer"
    3. Edit -> Project Settings -> Player -> Resolution and Presentation -> enabled the check in "Disable Depth and Stencil"
    4. Edit -> Project Settings -> Quality -> Rendering -> changed "Anti Aliasing" option to "Disabled".
    5. Rotated the device.
    6. There is only one Scene that is shown right after the Splash screen.
    7. 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)
     
  20. rmpinheiro

    rmpinheiro

    Joined:
    Apr 28, 2018
    Posts:
    2
    Found it:
    1. Edit -> Project Settings -> Player -> Other Settings.
    2. Disabled the check in "Auto Graphics API"
    3. 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).
     
  21. mon_carito

    mon_carito

    Joined:
    Sep 26, 2018
    Posts:
    2
    New
    I have the same problem with Sony Xperia Xa1 Modelo G3123 Andorid 8, I try all the solutions but it did not work, someone found a solution?
     
  22. RyanMartin

    RyanMartin

    Joined:
    Feb 20, 2017
    Posts:
    10
    Try disabling Multithreaded Rendering in Player Settings.
     
    apacomputer1 likes this.
  23. hereisfahad

    hereisfahad

    Joined:
    Oct 26, 2018
    Posts:
    1
    Thanks a lot!
     
  24. unity_f-uexkcOmaCX7g

    unity_f-uexkcOmaCX7g

    Joined:
    Jan 28, 2019
    Posts:
    1
    Hi... I did this one .. and it works ,,, Thanks a lot
     
  25. apacomputer1

    apacomputer1

    Joined:
    Apr 21, 2019
    Posts:
    1
    Thanks a lot! :)
     
  26. akhilnlb

    akhilnlb

    Joined:
    Jun 13, 2019
    Posts:
    1
     
  27. sahadha777

    sahadha777

    Joined:
    Jul 14, 2018
    Posts:
    15
    Did you fix this error? I also came to the same situation working with Vuforia cam. Could you help me if you are already solved this?
     
  28. khanhabib

    khanhabib

    Joined:
    Oct 11, 2018
    Posts:
    19
    I Enable "Auto Graphics API" in Other Setting and worked for me.
     
  29. Caraujo87

    Caraujo87

    Joined:
    Feb 8, 2019
    Posts:
    1
    i have unity 2017 lts, and doesnt appear this graphics option to enable or disble openGL. What can i do? My app run perfect on unity but ar camera turns black when i run the apk on my android phone
     
  30. HopeInfo

    HopeInfo

    Joined:
    May 16, 2019
    Posts:
    2
    Double check the Delayed Initialization is disable on Vuforia configuration. I think it will solved black screen issues on mobile device. But how can solved "ARCamera take too much time to open at that time application does stuck"
     
  31. teamorka01

    teamorka01

    Joined:
    Jul 29, 2018
    Posts:
    1
    In my case, it was an Obi Fluid asset that was causing the problem. I had disabled one of the emitters, but forgot to remove the reference obi simple fluid renderer script from ARCamera.
     
unityunity