Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in ARCoreHandleExtensions and ARCoreExtensions #189

Open
pAnderDev opened this issue Apr 19, 2024 · 2 comments
Open

Comments

@pAnderDev
Copy link

I've been trying to use ARCloud anchors to use persistent anchors in my project. I imported the sample projects for persistant anchors but I have an issue that I can't figure out. I keep getting a NullReferenceException when referencing the Session.subsystem. Initially on startup I have a typecast error on line 213 of ARCoreExtensions
image
Then and object reference error at line 354
image
Then in reference to the AR session subsystem and SessionHandle()
image
Last I have object reference errors that continue each frame as it is found in the Update method in the ARCoreExtensionsHandle
image|
This is happening in both my personal attempts to write a script to handle the hosting, resolving, and placement of the anchors as well as the sample project which I have not changed. I'm also using ARF 5 and have the correct script complication symbol ARCORE_USE_ARF_5. I'm developing for Android. If anyone has found how to fix this that would be greatly appreciated. I feel it is a deprecation that I'm missing and hasn't been updated yet but I am unsure.

@Raidanin
Copy link

I'm trying to use the geospatial creator, and I get the same issue when I run it in the editor.

@Raidanin
Copy link

I think I found a solution.

  1. Find Google.XR.ARCoreExtensions.asmdef file and fix the typing error (may optional)

        "name": "com.unity.xr.arfoundation",
         "expression": "[5.0,6.0)",
         "define": "ARCORE_USE_ARF_4"  >>  "define": "ARCORE_USE_ARF_5" 
    

#190

  1. Modify classes that are no longer used in ARCoreExtensions.cs

private ARCoreSessionSubsystem _arCoreSubsystem; >> private XRSessionSubsystem _arCoreSubsystem;

private ARCameraSubsystem _arCoreCameraSubsystem; >> private XRCameraSubsystem _arCoreCameraSubsystem;

And comment out the few configuration methods that are causing errors.
Even after looking through the official documentation, I couldn't find a similar method. If you have a better opinion, please let me know.

After doing this, the built application worked normally. Hope this can help you.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants