Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 139 forks source link

Android sample app cannot find azurespatialanchorsndk #154

Closed AlekseiBo closed 4 years ago

AlekseiBo commented 4 years ago

Hello! I am running the sample scene on Android using Unity 2019.2.21 and get the following error

DllNotFoundException: Unable to load DLL 'azurespatialanchorsndk': The specified module could not be found.

Microsoft.Azure.SpatialAnchors.NativeLibrary.ssc_anchor_locate_criteria_create (System.IntPtr& instance) (at <00000000000000000000000000000000>:0) Microsoft.Azure.SpatialAnchors.AnchorLocateCriteria..ctor () (at <00000000000000000000000000000000>:0) Microsoft.Azure.SpatialAnchors.Unity.Examples.DemoScriptBase.Start () (at <00000000000000000000000000000000>:0) Microsoft.Azure.SpatialAnchors.Unity.Examples.AzureSpatialAnchorsCoarseRelocDemoScript.Start () (at <00000000000000000000000000000000>:0)

Please advice.

jparismorgan commented 4 years ago

Hi @AlekseiBo, thanks for letting us know. We've seen this issue come up a few times before. Could you take a look at these two past issues and see if either solve your issue?

If that doesn't work, could you:

Thanks!

darax commented 4 years ago

Hey @AlekseiBo I noticed you are running Unity, so the link you'll want to check out is: https://docs.microsoft.com/en-us/azure/spatial-anchors/quickstarts/get-started-unity-android

It is possible that a dependency that Azure Spatial Anchors relies upon is missing. One possible thing to try (aside from checking the link above) would be to update the ARFoundation and related components through the Unity package manager.

MarcinKulwicki commented 4 years ago

Link to ISSUE https://github.com/Azure/azure-spatial-anchors-samples/issues/155

I have the same problem with Unity and Android builds.

I set up on the Scene AzureSpatialAnchorsBasicDemo/AzureSpatialAnchors the Account Id And Account Key. I set up Account Key and Account Id in AzureSpatialAnchors.SDK/Resources/SpatialAnchorConfig I grant in Application Settings on Phone access to memory and localization

Firstly i try on Unity 2019.1.10 and AR Fundation 2.2.0 prev 2 Now i trying on Unity 2019.3.0f6 and

    "com.unity.xr.arcore": "2.2.0-preview.6",
    "com.unity.xr.arfoundation": "2.2.0-preview.6",
    "com.unity.xr.arkit": "2.2.0-preview.6",
    "com.unity.xr.arsubsystems": "2.2.0-preview.6",

Still the same error. Any idea?

Full error

2020-04-15 00:06:15.985 30354-30427/? E/Unity: CloudSpatialException
      at Microsoft.Azure.SpatialAnchors.NativeLibraryHelpers.CheckStatus (System.IntPtr handle, Microsoft.Azure.SpatialAnchors.status value) [0x00180] in <b30c8119b19f43978cde6dd2a9f6c77f>:0 
      at Microsoft.Azure.SpatialAnchors.CloudSpatialAnchorSession+<>c__DisplayClass82_0.<CreateAnchorAsync>b__0 () [0x00035] in <b30c8119b19f43978cde6dd2a9f6c77f>:0 
      at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <7d97106330684add86d080ecf65bfe69>:0 
      at System.Threading.Tasks.Task.Execute () [0x00010] in <7d97106330684add86d080ecf65bfe69>:0 
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7d97106330684add86d080ecf65bfe69>:0 
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <7d97106330684add86d080ecf65bfe69>:0 
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading
2020-04-15 00:06:15.987 30354-30427/? I/Unity: Failed to save anchor Microsoft.Azure.SpatialAnchors.CloudSpatialException
      at Microsoft.Azure.SpatialAnchors.NativeLibraryHelpers.CheckStatus (System.IntPtr handle, Microsoft.Azure.SpatialAnchors.status value) [0x00180] in <b30c8119b19f43978cde6dd2a9f6c77f>:0 
      at Microsoft.Azure.SpatialAnchors.CloudSpatialAnchorSession+<>c__DisplayClass82_0.<CreateAnchorAsync>b__0 () [0x00035] in <b30c8119b19f43978cde6dd2a9f6c77f>:0 
      at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <7d97106330684add86d080ecf65bfe69>:0 
      at System.Threading.Tasks.Task.Execute () [0x00010] in <7d97106330684add86d080ecf65bfe69>:0 
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7d97106330684add86d080ecf65bfe69>:0 
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <7d97106330684add86d080ecf65bfe69>:0 
      at System.Runtime.CompilerServices.TaskAwaiter.Hand
darax commented 4 years ago

@MarcinKulwicki the OP's issue is they aren't loading the library. Since you have a stack from our library, your issue looks different. Did you intend to respond to a different issue? If not, please open a new one. Thanks!

RamonArguelles commented 4 years ago

Hi @AlekseiBo. Have you been able to try out the suggestion from @darax? Let jus know if you are still having dll issues if you have, so that we can try to dig further. Thanks.

no-response[bot] commented 4 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.