Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Domain=GARSession Code=-3 when I try host cloud anchor #21

Closed
SavinovJr opened this issue May 3, 2019 · 5 comments
Closed

Error Domain=GARSession Code=-3 when I try host cloud anchor #21

SavinovJr opened this issue May 3, 2019 · 5 comments

Comments

@SavinovJr
Copy link

Hi guys,
I'm working on cloud anchors api and I have an issue when I try host cloud anchor. I don't use firebase as it is in sample.

So my source code the next:

`- (void)viewDidLoad {
....

NSError *error = nil;
self.gSession = [GARSession sessionWithAPIKey:@"my_key"
                             bundleIdentifier:nil
                                        error:&error];
self.gSession.delegate = self;
self.gSession.delegateQueue = dispatch_get_main_queue();

}`

In this place gSession is OK. There isn't any errors. When ARTrackingState is ARTrackingStateNormal then I perform tap:

` - (void)addImageWithGestureRecognizer:(UITapGestureRecognizer *)gestureRecognizer {

CGPoint tapLocation = [gestureRecognizer locationInView:self.sceneView];
NSArray<ARHitTestResult *> *hitTestResult = [self.sceneView hitTest:tapLocation types:ARHitTestResultTypeExistingPlane | ARHitTestResultTypeExistingPlaneUsingExtent | ARHitTestResultTypeEstimatedHorizontalPlane | ARHitTestResultTypeEstimatedVerticalPlane | ARSCNDebugOptionShowFeaturePoints];
if (!hitTestResult.firstObject && self.needDetectPlane) {
    return;
}

ARHitTestResult *result = hitTestResult.firstObject;

self.arAnchor = [[ARAnchor alloc] initWithName:@"My anchor" transform:result.worldTransform];
[self.sceneView.session addAnchor:self.arAnchor];

NSError *error = nil;
self.garAnchor = [self.gSession hostCloudAnchor:self.arAnchor error:&error];
MyLog(@"Host Cloud Anchor Error: %@", error); 

}`

and I get error in this place: Error Domain=GARSession Code=-3. What did I miss?

Poddile.lock is the next:
` PODS:

  • ARCore (1.8.0):
    • GoogleToolboxForMac/Logger (~> 2.1)
    • "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
    • GTMSessionFetcher/Core (~> 1.2)
    • Protobuf (~> 3.5)
  • BlocksKit (2.2.5):
    • BlocksKit/All (= 2.2.5)
  • BlocksKit/All (2.2.5):
    • BlocksKit/Core
    • BlocksKit/DynamicDelegate
    • BlocksKit/MessageUI
    • BlocksKit/UIKit
  • BlocksKit/Core (2.2.5)
  • BlocksKit/DynamicDelegate (2.2.5)
  • BlocksKit/MessageUI (2.2.5):
    • BlocksKit/Core
    • BlocksKit/DynamicDelegate
  • BlocksKit/UIKit (2.2.5):
    • BlocksKit/Core
    • BlocksKit/DynamicDelegate
  • Bolts (1.9.0):
    • Bolts/AppLinks (= 1.9.0)
    • Bolts/Tasks (= 1.9.0)
  • Bolts/AppLinks (1.9.0):
    • Bolts/Tasks
  • Bolts/Tasks (1.9.0)
  • FBSDKCoreKit (4.38.1):
    • Bolts (~> 1.9)
  • FBSDKLoginKit (4.38.1):
    • FBSDKCoreKit
  • FBSDKShareKit (4.38.1):
    • FBSDKCoreKit
  • GoogleToolboxForMac/Defines (2.2.0)
  • GoogleToolboxForMac/Logger (2.2.0):
    • GoogleToolboxForMac/Defines (= 2.2.0)
  • "GoogleToolboxForMac/NSData+zlib (2.2.0)":
    • GoogleToolboxForMac/Defines (= 2.2.0)
  • GTMSessionFetcher/Core (1.2.1)
  • IQKeyboardManager (6.3.0)
  • LGSideMenuController (2.1.1)
  • Protobuf (3.7.0)

DEPENDENCIES:

  • ARCore
  • BlocksKit
  • FBSDKCoreKit (~> 4.38.0)
  • FBSDKLoginKit (~> 4.38.0)
  • FBSDKShareKit (~> 4.38.0)
  • IQKeyboardManager
  • LGSideMenuController
  • Protobuf

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- ARCore
- BlocksKit
- Bolts
- FBSDKCoreKit
- FBSDKLoginKit
- FBSDKShareKit
- GoogleToolboxForMac
- GTMSessionFetcher
- IQKeyboardManager
- LGSideMenuController
- Protobuf

SPEC CHECKSUMS:
ARCore: e907a1e975726eed59ad72e10e3226a8246e2417
BlocksKit: 7f422b971407001178d181a43b99014ea2591fe6
Bolts: ac6567323eac61e203f6a9763667d0f711be34c8
FBSDKCoreKit: 8d47857400e2f5bdea697a80daff882e91c84ef6
FBSDKLoginKit: 4621c690d9dd8628031a4791497062183ea34b0d
FBSDKShareKit: 6ffe22f0a0618eb7424d4104ab0ef3ce9643d42a
GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca
IQKeyboardManager: 2ca9d64893247556f53523dcd8d78641f0ba7c23
LGSideMenuController: ae40c80983ab8b8801c7cef0a6804d43aaa72d45
Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a

PODFILE CHECKSUM: d59f2f2ffcd3e11902fa1348a24f026942f0023e

COCOAPODS: 1.6.0
`

@sammcd
Copy link
Contributor

sammcd commented May 3, 2019

Hello! And sorry you are running into this issue.

That error means that we don't think ARKit is tracking properly, but you already mentioned that have confirmed that it is.

Are you callingself.gSession's update: method with the current frame? We have an example of how to do this in our developer guide here: https://developers.google.com/ar/develop/ios/cloud-anchors-developer-guide-ios under the "Passing ARFrames to the GARSession" section.

@SavinovJr
Copy link
Author

yes, I do it like this:

-(void)session:(ARSession *)arSession didUpdateFrame:(ARFrame *)arFrame { [self.gSession update:arFrame error:nil]; }

@SavinovJr
Copy link
Author

@sammcd Hi. Do you have any updates/suggestions for this issue?

@sammcd
Copy link
Contributor

sammcd commented May 7, 2019

Apologies for the slow response time, and thanks for following up!

I reviewed our code for every case that this error message can be returned, and it really looks like our library is not getting ARFrames that are in a good tracking state. Here are the next steps I would take to debug.

  1. Confirm that the ARSession's delegate is set and session:didUpdateFrame: is getting called by logging something.
  2. NSLog out the ARFrame's tracking state right before you call our update:error: method. I would look to check that the tracking state is good right before your host call.

Please let me know if that helps out at all or if you still get the same error.

@SavinovJr
Copy link
Author

SavinovJr commented May 7, 2019

@sammcd , Hi. You will smile but I forgot set ARSession's delegate. It was my fault. For now I get the correct cloud anchor in
- (void)session:(GARSession *)session didHostAnchor:(GARAnchor *)anchor

Thanks for your time. I will close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants