Search Unity

Black Screen

Discussion in 'AR/VR (XR) Discussion' started by TudorMaximilian, Dec 3, 2018.

  1. TudorMaximilian

    TudorMaximilian

    Joined:
    Dec 16, 2017
    Posts:
    7
    After I build a project for android, there is only black screen after the unity logo appears. I want to fix this first of all otherwise the project won't work. I am using Unity 2018.1.0f. It happened many times with different build attempts, now I had to go back to a previous version of the project to build it.

    Please help!
     
  2. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    No one can help with such info. You did not mention how the issue is related to XR, what SDK, what did your error log say, what device did you use etc.
     
  3. TudorMaximilian

    TudorMaximilian

    Joined:
    Dec 16, 2017
    Posts:
    7
    Oh sorry, so my project is for VR Cardboard. I used for testing the Samsung S9 and also the ZTE Axon 7 Mini.

    In error log there are 2 red errors:


    "TargetException: Non-static method requires a target.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <e1a80661d61443feb3dbdaac88eeb776>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <e1a80661d61443feb3dbdaac88eeb776>:0)
    UnityEditor.EditorAssemblies.ProcessInitializeOnLoadMethod (System.Reflection.MethodInfo method) (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:116)
    UnityEditor.EditorAssemblies.ProcessInitializeOnLoadAttributes () (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:135)"

    and
    "NullReferenceException: Object reference not set to an instance of an object
    FloorManager.Update () (at Assets/Cardboard VR Walking Running and Jumping/Scripts/FloorManager.cs:26)"

    I don't know if the second one matters but the script for it is the following( it refers to "if (floor.transform.position.x < player.transform.position.x - playeroffset)":

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class FloorManager : MonoBehaviour
    {

    public GameObject[] floors;
    public WalkingFilter player;
    public float floorSize;

    public float playeroffset = 120f;


    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
    foreach (GameObject floor in floors)
    {
    if (floor.transform.position.x < player.transform.position.x - playeroffset)
    {
    floor.transform.position = new Vector3(
    floor.transform.position.x + floorSize * floors.Length,
    floor.transform.position.y,
    floor.transform.position.z);
    }
    }
    }
    }