Arcore-unity-sdk: ARCore 1.2 throws InvalidOperationException when using with .NET 4.6

Created on 9 May 2018  路  9Comments  路  Source: google-ar/arcore-unity-sdk

Hi,
Every time I switch to .NET 4.6 the new ARCore 1.2 is throwing InvalidOperationException from session config.

StackTrace:
InvalidOperationException: Handle is not initialized.
System.Runtime.InteropServices.GCHandle.Free () (at :0)
GoogleARCoreInternal.ARCoreAndroidLifecycleManager.SetConfiguration (GoogleARCore.ARCoreSessionConfig config) (at Assets/GoogleARCore/SDK/Scripts/Managers/ARCoreAndroidLifecycleManager.cs:83)
GoogleARCoreInternal.ARCoreAndroidLifecycleManager.EnableSession () (at Assets/GoogleARCore/SDK/Scripts/Managers/ARCoreAndroidLifecycleManager.cs:112)
GoogleARCoreInternal.ARCoreAndroidLifecycleManager.CreateSession (GoogleARCore.ARCoreSession sessionComponent) (at Assets/GoogleARCore/SDK/Scripts/Managers/ARCoreAndroidLifecycleManager.cs:101)
GoogleARCore.ARCoreSession.Start () (at Assets/GoogleARCore/SDK/Scripts/ARCoreSession.cs:42)

Thanks,
Smart AR Home team
http://smartarhome.com/

bug fixed in upcoming release

Most helpful comment

And here is the fix in case someone will hit the same issue:

\GoogleARCore\SDK\Scripts\Managers\ARCoreAndroidLifecycleManager.cs -> public void SetConfiguration(ARCoreSessionConfig config):
Change
handle.Free();
to

if (handle.IsAllocated)
{
        handle.Free();
}

btw, nice ARCore 1.2 update today Google!! So much nice stuff! :)

Thanks,
Smart AR Home team
http://smartarhome.com/

All 9 comments

In the instant preview I can still see the background texture but when deployed to the device it's just a black screen.

Thanks,
Smart AR Home team
http://smartarhome.com/

And here is the fix in case someone will hit the same issue:

\GoogleARCore\SDK\Scripts\Managers\ARCoreAndroidLifecycleManager.cs -> public void SetConfiguration(ARCoreSessionConfig config):
Change
handle.Free();
to

if (handle.IsAllocated)
{
        handle.Free();
}

btw, nice ARCore 1.2 update today Google!! So much nice stuff! :)

Thanks,
Smart AR Home team
http://smartarhome.com/

Hi, thanks for the bug report and proposing a fix. I added it to our internal tracking to fix it for next releases.

We love it when individuals report a problem, solve the problem they reported, and give us a compliment! As pablisho alluded to we will have this fixed next release :)

P.S. I like the music in your website's video dzak83!

Thanks! I am glad I could help :)

Hey I am experiencing the same issue
https://github.com/google-ar/arcore-unity-sdk/blob/99d51802ee27cae1a98812f4c04ae8b0ac7e1e1b/Assets/GoogleARCore/SDK/Scripts/Managers/ARCoreIOSLifecycleManager.cs#L75-L77

This is now empty I am not sure why=) and I am having the following error when trying to run HelloAR project
screenshot_23

Hi the error you show references AndroidLifecycleManager and the code you reference is IOSLifecycleManager. This issue will be fixed in the next release.

Oh yeah, my bet. Found now where the fix should go. Thank you.

Hi, this issue has been fixed in ARCore Unity SDK v1.3.0. Feel free to reopen if you still experience the issue.

Was this page helpful?
0 / 5 - 0 ratings