google-ar / arcore-unity-sdk

ARCore SDK for Unity

Home Page:https://developers.google.com/ar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to host cloud anchor: ErrorNotAuthorized

aphares opened this issue · comments

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 have enabled the Cloud Anchor API in my google cloud project
  • I have created my own keystore and use it in Unity's project settings, and created the OAuth client on the cloud.

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:b__33_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>b__1()
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)

Trying with API key works, while using keyless fails

Same here. Any luck further?

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?

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

How did you update the gradle version in Unity3d?

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