Hi Andreas,
my first quick tests looked very good, the app does not crash anymore. I think we will wait for the release and everything will be fine.
Thank you for the updates and the great communication, too!
Ole
Hi Ole,
I have some good news for you. You can download a Wikitude iOS Native SDK here. Please note that we didn't do a complete release test for that version. The fixes are included in the major update which we release end of January. The changes I did are isolated to a small part of the SDK but change some important assumptions.
Please give it a try and let me know how it works for you.
I also wanted to thank you for reaching out to us and make us aware of this issue.
Best regards,
Andreas
Hi Andreas,
thanks for the info, that's good to know!
Hi Ole,
Thx for the demo project. I already had a look at it and could reproduce the issue. Unfortunately the fix causes another tricky issue which I'm now investigating. I send you more infos ASAP.
Best regards,
Andreas
Hi Ole,
Thx for the demo project. I will have a look at it this week and send you some information asap.
Best regards,
Andreas
Hi Andreas,
here is my customized Wikitude example code:
https://cap3gmbh.s3.amazonaws.com/public/Examples-01.zip
Perhaps it will not crash the first time coming back from the dummy view controller but on my test device (iPhone 6, iOS 10.1.1) the example always crashes.
I hope you can reproduce the problem.
Hi Ole,
I tried it myself right now with our latest release (1.4.1) and was unable to reproduce the issue. Can you send us a code snippet where you delete the tracker and create a new one?
THX!
Andreas
Hi Andreas,
I made some tests and unfortunately setting the clientTracker to nil results in a crash for me when trying to create a new tracker. The app crashs too if I don't set the old one to nil. Do you have an idea what I might be doing wrong?
I only have this stack trace:
#0 0x000000010071bf14 in wikitude::sdk_foundation::impl::CameraService::newPlatformCameraFrameAvailable(wikitude::sdk_foundation::impl::FrameInfo) ()
#1 0x00000001005c4ed4 in _ZNSt3__110__function6__funcIZZ97-[WTNativeSDKManager cameraPlatformService:didOutputNextCameraFrameWithId:presentationTimestamp:]EUb_E3$_2NS_9allocatorIS2_EEFvRN8wikitude14sdk_foundation4impl13CameraServiceEEEclES9_ ()
#2 0x00000001005c401c in __97-[WTNativeSDKManager cameraPlatformService:didOutputNextCameraFrameWithId:presentationTimestamp:]_block_invoke ()
Hi Ole,
You're welcome ;) Let me know if it's working.
Best regards,
Andreas
Hi Andreas,
alright, thanks again!
Hi Ole,
I'm glad it's working for you. We will update the example in the next release.
Regarding your tracker question: The equivalent on iOS is to set the tracker to nil.
Best regards,
Andreas
Hi Andreas,
thank you very much for your help. The crash does not occur anymore and we are really happy!
I have only one more question regarding your last hint: Sometimes our tracker file has to be updated while the app is running and the view is displayed. For Android there is a method called "destroyTracker" on the tracker manager. Is there any equivalent for iOS?
Thank you very much.
Hi Ole,
I found the reason for the OpenGL error you experience. Luckily it's purely related to the example setup. You just need to do two small edits and it will work.
The first change is in the view controllers -viewDidDisappear: method. Simply replace it with the following snippet:
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
[self.wikitudeSDK stop];
[self.renderableRectangle releaseProgram]; // first change
[self.renderer stopRenderLoop];
[self.renderer teardownRendering];
_sharedWikitudeEAGLCameraContext = nil; // second change
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
The second change is in the ExternalRenderer method -teardownRendering:
- (void)teardownRendering
{
self.externalRenderBlock = nil;
if (_colorRenderbuffer)
{
WT_GL_ASSERT( glDeleteRenderbuffers(1, &_colorRenderbuffer) );
}
if (_framebuffer)
{
WT_GL_ASSERT( glDeleteFramebuffers(1, &_framebuffer) );
}
if (_eaglContext)
{
[_eaglContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:nil]; // detach render buffer from the current context
self.eaglContext = nil;
}
}
I also only create the tracker if needed like this:
if ( !_clientTracker )
{
NSURL *clientTrackerURL = [[NSBundle mainBundle] URLForResource:@"magazine"withExtension:@"wtc" subdirectory:@"Assets"];
self.clientTracker = [self.wikitudeSDK.trackerManagercreate2DClientTrackerFromURL:clientTrackerURL extendedTargets:nil andDelegate:self];
}
Please let me know if that works for you.
Best regards,
Andreas
Hi Ole,
Thx for the demo project. I'm able to reproduce the problem and started investigation. I let you know once I know more about the problem.
Best regards,
Andreas
Ole Cordsen
If I adjust the iOS native example to present a view controller on successful target recognition like:
I get the following error message: "unable to set renderbuffer storage from drawable".
My example is kind of artificial but the same error occurs with a real view controller.
Do you have any hint for me? Thank you very much for any help.