Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug AR Foundation — ARCore: OPENGL NATIVE PLUG-IN ERROR

Discussion in 'AR' started by makaka-org, Mar 30, 2024.

  1. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,076
    I got different errors below after these lines executed (I enable AR manually):

    Code (CSharp):
    1. xrOrigin.gameObject.SetActive(true);
    2. arSession.gameObject.SetActive(true);
    AR Plane Manager, AR Point Cloud Manager, AR Raycast manager: components are not enabled still at this stage.

    Production Build:
    OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_OPERATION: Operation illegal in current state

    Debug Build:
    OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_VALUE: Numeric argument out of range

    ---------
    Result:
    2 Textures have random glitching after doing this.
    ---------

    AR Foundation 5.1.3, 5.1.2.
    Plane Detection.
    Auto Graphics API: unchecked
    Graphics APIs: OpenGLES3

    Why can this happen?

    P.S. I have no such error with Image Tracking.
     
    Last edited: Mar 30, 2024
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,135
    AR Foundation is only an interface for AR Functionality. It does not implement AR (unless you are referring to XR Simulation specifically). For starters we would need to know which platform(s) you are building for, and your XR Plug-in Management settings, before we could reason about this.
     
  3. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,135
    Looking at this a second time, I wouldn't expect these to work in this order. ARSession is the root of all platform lifecycle. I think you might need ARSession alive first before you enable XR Origin, otherwise I'm not sure how XR Origin could attempt to get an origin pose. Origin of what, if there is no ARSession?
     
  4. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,076
    Tested with Galaxy A71.

    There are no issues with my order on:
    • iOS + Plane Detection,
    • iOS & Android + Image Tracking
    If I change the order as you said, I get this message with XR Simulation and then NO Plane Detection in Editor:
    Code (CSharp):
    1. An XR Origin is required in the scene, none found.
    2. UnityEngine.XR.ARFoundation.ARSession:OnEnable ()
    So, with the order in the original post there are no errors and working Plane Detection.

    Screenshot 2024-04-05 at 01.15.09.png Screenshot 2024-04-05 at 01.17.06.png
     
  5. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,135
  6. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,076
    The issue was disappeared.
    I guess, the issue was related to some native Samsung applications (they were updated), not to OS updates.