google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 403 forks source link

Failed to host cloud anchor: ErrorNotAuthorized #761

Closed aphares closed 3 years ago

aphares commented 3 years ago

I am running the Persistent Cloud Anchor example on android, and trying to host cloud anchors using keyless authentication with oauth 2.0. Whenever it calls XPSession.createCloudAnchor(), it returns ErrorNotAuthorized. I have gone through the causes for this error from the doc

I'm trying to find more info (even more error data), but there's very little context for what could be causing this error. Here is the full adb error if it helps:

10-17 17:09:46.624 7432 7472 I Unity : Failed to host cloud anchor: ErrorNotAuthorized 10-17 17:09:46.624 7432 7472 I Unity : GoogleARCore.Examples.PersistentCloudAnchors.ARViewManager:b33_0(CloudAnchorResult) 10-17 17:09:46.624 7432 7472 I Unity : System.Action`1:Invoke(T) 10-17 17:09:46.624 7432 7472 I Unity : GoogleARCore.<>c__DisplayClass1_0:<.ctor>b1() 10-17 17:09:46.624 7432 7472 I Unity : System.Action:Invoke() 10-17 17:09:46.624 7432 7472 I Unity : GoogleARCore.AsyncTask:OnUpdate() 10-17 17:09:46.624 7432 7472 I Unity : System.Action:Invoke() 10-17 17:09:46.624 7432 7472 I Unity : GoogleARCoreInternal.ARCoreAndroidLifecycleManager:OnEarlyUpdate() 10-17 17:09:46.624 7432 7472 I Unity : System.Action:Invoke() 10-17 17:09:46.624 7432 7472 I Unity : 10-17 17:09:46.624 7432 7472 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

aphares commented 3 years ago

Trying with API key works, while using keyless fails

ipruthviraj commented 3 years ago

Same here. Any luck further?

theERJ commented 3 years ago

Same issue. Existing project updated to 1.23 and despite following every step on arcore guide, I still get errorNotAuthorized if I use keyless. Anyone made any progress?

kshitizsv-vizara commented 3 years ago

https://github.com/google-ar/arcore-unity-extensions/issues/22#issuecomment-789668919

This might help.

theERJ commented 3 years ago

Thanks! That worked! I used Unity 2019.4.15f1 and it worked, so seems like the new Gradle is the key!

ghost commented 3 years ago

How did you update the gradle version in Unity3d?

ghost commented 3 years ago

The solutions offered here no longer work. I have tried running the Persistent cloud anchor sample app and I still can't host anchors.

@kshitizsv-vizara your provided solution does not work