google-ar / arcore-ios-sdk

ARCore SDK for iOS
https://developers.google.com/ar/
Apache License 2.0
283 stars 84 forks source link

Error when resolving anchors. No callback received. #100

Open vishal219 opened 7 months ago

vishal219 commented 7 months ago

We are having an AR application which saves the cloud anchor ids in the backend and then retrieves it & tries to resolve the anchor.

private func resolvedAnchors() { guard let deviceLastLocation = deviceLastLocation else { return }

    self.mementosVM.getAllMementos().forEach {[weak self] memento in
        guard let self = self else { return }

        if let anchorId:String = memento.anchor_id {
            printObj("AnchorId: "+anchorId)

            self.googleSession?.resolveCloudAnchor(anchorId: anchorId)
        }
    }
}

and I don't get any failure callbacks in didFailToResolve but sometimes when it is able to fetch the anchor I do receive didResolve callback.

Used to work fine like a month ago. Suddenly the resolving is taking too long & fails to resolve multiple calls.

15kingben commented 7 months ago

Hi Vishal, can you provide a minimum reproducible sample project? Also, do you see the same behavior when using the asynchronous APIs e.g. https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#resolvecloudanchorwithidentifier:completionhandler:error:

vishal219 commented 7 months ago

Sample.zip @15kingben Here is the sample app. You will need to add your google-info.plist and api key. I have used local storage (UserDefaults for anchor Ids) in this.

15kingben commented 7 months ago

Is this issue related to https://github.com/google-ar/arcore-unity-extensions/issues/56, cloud anchors not hosting when TTL = 365?

vishal219 commented 7 months ago

No. It's not. It is regarding slow resolving and sometimes not resolving in case of multiple anchor resolving request simultaneously.

vishal219 commented 7 months ago

Also receiving the following state for anchors: GARCloudAnchorStateErrorInternal in the callback