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

Fatal error while trying to create sync service #12

Closed
michaeldeprospo opened this issue May 4, 2021 · 5 comments
Closed

Fatal error while trying to create sync service #12

michaeldeprospo opened this issue May 4, 2021 · 5 comments

Comments

@michaeldeprospo
Copy link

Hello - Thank you for your hard work on this project!

I've setup my ARViewController based on the provided example project. I have all of the correct entries in my info.plist. When running the app, the build succeeds but immediately fails in the func setupMultipeer() while trying to set RealityKit syncronization during:

guard let syncService = multipeerHelp.syncService else { fatalError("could not create multipeerHelp.syncService") }

Could you provide any insight as to why this may be happening?

@maxxfrazer
Copy link
Owner

Hi! Sorry you're having issues - are there no logs shown before that may say why it's happening?

The main reasons I'm aware of where this might happen would be issues with Info.plist values or if the user has not allowed local network access.

To be sure, if you set the serviceName to "service", the values in Info.plist should be _service._tcp and _service._udp
Also the Privacy - Local Network Usage Description is added?

@michaeldeprospo
Copy link
Author

michaeldeprospo commented May 4, 2021

Thanks for the fast reply - no nothing else in the logs I'm afraid - I triple checked my info.plist entries, I have the correct entries for Bonjour services, as well as Privacy - Local Network Usage Description. I am not doing anything else in my app that would be preventing this from working as far as I can tell.

I am using the latest XCode (12.5) + Building for iOS 14.5, though I have tried this package earlier on with older versions of iOS 14 and have experienced the same crash. Please let me know if there is any other information I can provide. Would really love to use this package.

UPDATE -

Some interesting information. I have a similar function to yours that sets up my ARView configuration, and runs the AR session. One of the lines I have in there is arView.environment.sceneUnderstanding.options.insert(.physics) for some additional features I have in my app.

Two things I noticed - when commenting out this line in my configuration, and running on my dev device (iPhone 12 Pro Max), the app does not crash in the same spot it has been. However, when this line is left in, it will crash when trying to setup the service. The second thing is, when keeping this line in and running on my personal device (iPhone 11 Pro), it does not crash either way. Just to confirm this, I added this same line into the setupARView() function in your example project, and it too crashes on the iPhone 12 Pro.

Not sure what could be causing this. Both devices are configured the same. The only difference that I can speak to is that the 12 Pro has a LiDAR sensor on it, though I'm not sure if this would have any effect on multipeer functionality.

@maxxfrazer
Copy link
Owner

I remember seeing in a WWDC event last year that they said that scene understanding physics does not work across MPC. I don't remember them saying it will crash it - but it's unlike Apple to say exactly that!

You said that adding the .physics option crashes it, and the crash happens on multipeerHelp.syncService. But I'd have thought of those two as completely separate until you call arView.scene.synchronizationService = syncService.

@michaeldeprospo
Copy link
Author

It is odd - not sure if you want to investigate further on your end, but this is resolved for me.

@kampfz
Copy link

kampfz commented Jan 22, 2022

@maxxfrazer @michaeldeprospo did either of you by chance do any additional research on this? I'm wondering if there's a way to make it work still if at all possible

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

3 participants