Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Just looking for the most basic, simple directions to get AR working for Android Unity 2022.3

Discussion in 'AR' started by ValentineCat, Sep 11, 2023.

  1. ValentineCat

    ValentineCat

    Joined:
    Feb 15, 2021
    Posts:
    10
    Following the tutorials but they require 2019. Watched a number of youtube videos but still have issues. I got a few of the unity mobile AR tutorials to work over the weekend, but now all of a sudden I just get a black screen and errors like:
    "Saving has no effect. Your class 'UnityEditor.XR.Simulation.XREnvironmentViewManager' is missing the FilePathAttribute. Use this attribute to specify where to save your ScriptableSingleton.
    Only call Save() and use this attribute if you want your state to survive between sessions of Unity.
    UnityEditor.XR.Simulation.XREnvironmentViewManager:OnDisable () (at ./Library/PackageCache/com.unity.xr.arfoundation@5.0.7/Editor/Simulation/XREnvironmentViewManager.cs:169)"

    I love unity but am beyond frustrated right now as I can't even get the most basic build to work setting up with AR Core project and selecting Android as the build platform. I can only think to uninstall Unity yet again and reinstall but there must be something I'm missing. Thanks for any help.
     
  2. xiennastudio

    xiennastudio

    Joined:
    Aug 2, 2023
    Posts:
    19
  3. ValentineCat

    ValentineCat

    Joined:
    Feb 15, 2021
    Posts:
    10
    thank you so much! I finally figured it out, but will definitely watch your tutorials as well. for anyone wondering why you have a black background when building AR apps, as I struggled with, in your XR Origin add a camera, tag it as Main Camera. you will have a black background because you are using Unity’s XR plugin for AR applications. In AR, the camera background is usually transparent, so that the real world can be seen through the device’s screen or lens. However, in Unity, transparent backgrounds are rendered as black by default. Therefore, you need to add a component called AR Camera Background to your XR origin camera, which will replace the black background with the device’s camera feed. This is done by clicking the camera then selecting Add Component in the Inspector and searching for AR Camera Background, you also need to add AR Camera Manager. then you will see the usual skybox background. it's been driving me crazy! upload_2023-9-12_10-22-8.png
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    989
  5. aleevans

    aleevans

    Joined:
    Jan 24, 2022
    Posts:
    1
    @ValentineCat How did you resolve the FilePathAttribute related warning? I am getting that exact same warning in Unity 2022.3.8 using AR Foundation 5.0.7.

     
  6. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    989
    @aleevans The FilePathAttribute issue is a known bug. You can ignore the warning for now. It's in our queue to investigate. We weren't aware of this issue until newer versions of the Editor started logging this warning recently.
     
    makaka-org, flintml and Lughinu like this.
  7. melitoren

    melitoren

    Joined:
    May 13, 2020
    Posts:
    5
    AndreaDAn and lilzubr like this.
  8. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    989
    @melitoren The FilePathAttribute warning shouldn't have any negative effect other than an annoyingly logged warning, no? We've had higher priority work this month but expect to get to this in November.
     
    AlonMixed likes this.
  9. Demiseman

    Demiseman

    Joined:
    Apr 26, 2023
    Posts:
    1
    no, its not just that, we cant save nothing, scripts dont load, so we cant make anything, i lost many proyects for this error, reinstall all unity for this its absurd... any news??
     
  10. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    989
    @Demiseman It sounds like there is some other issue in your project. This FilePathAttribute warning from AR Foundation does not have any of the effects you describe. "Saving has no effect" in this case simply means that AR Foundation is unable to save the XREnvironmentViewManager, which is a minor bug that has been present since AR Foundation 5.0.

    We have a patch coming out soon that will fix this warning being logged.
     
    makaka-org and thisisdivakars like this.
  11. Blixem-Media

    Blixem-Media

    Joined:
    Mar 4, 2015
    Posts:
    6
    The FilePathAttribute is causing a negative effect when you try to run your AR app in the simulator. The background of the camera is cleared with a solid black color and nothing is being rendered.

    The warning is followed by the error "No camera found under XROrigin." But my camera is set up correctly. The problem seems to be caused by a second camera that is added for navigating through the simulated AR scene when you run the app in te AR simulator.

    The complete error message looks as follows.

    No camera found under XROrigin.
    UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3<UnityEngine.XR.ARSubsystems.XRCameraSubsystem, UnityEngine.XR.ARSubsystems.XRCameraSubsystemDescriptor, UnityEngine.XR.ARSubsystems.XRCameraSubsystem/Provider>:OnEnable () (at ./Library/PackageCache/com.unity.xr.arfoundation@5.1.0/Runtime/ARFoundation/SubsystemLifecycleManager.cs:78)

    The only way to get around this FilePathAttribute warning and error is to load a different scene and then switch back to the scene that you're working on. This way the error disappears temporarily but it will come back each time you make a change to the scene, load assets or sometimes even when you switch to a different application and back to Unity.
     
  12. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    989
    @Blixem-Media The FilePathAttribute warning has no effect on the behavior you describe. It looks like your issue is the GameObject hierarchy of your XR Origin. Refer to our scene setup docs for the required setup.
     
    shravanmuniyoor likes this.