We have iOS cordova sample project and we made same changes to create a demo for poi based solution. It uses storyboard, Everything is fine here.
Now we works for integrate sample demo to our native application.
WTArhitectView works fine on uiviewcontroller, we see all pois, everything fine here. but when we pressed back button from navigation bar, application crashes after uiviewcontroller dealloc method.
here is log:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7fcfe30cf230 of class AVPlayer was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x7fcfe392dac0> (
<NSKeyValueObservance 0x7fcfe392da60: Observer: 0x7fcfe3928140, Key path: status, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x7fcfe392d730>
*** First throw call stack:
0 CoreFoundation 0x000000010ba03d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b47edeb objc_exception_throw + 48
2 CoreFoundation 0x000000010ba03cbd +[NSException raise:format:] + 205
3 Foundation 0x00000001074acd41 NSKVODeallocate + 294
4 libobjc.A.dylib 0x000000010b492afe _ZN11objc_object17sidetable_releaseEb + 232
5 WikitudeSDK 0x00000001053d316e -[WTVideoReader .cxx_destruct] + 43
6 libobjc.A.dylib 0x000000010b47d7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
7 libobjc.A.dylib 0x000000010b488332 objc_destructInstance + 93
8 CoreFoundation 0x000000010ba0cf76 -[NSObject(NSObject) __dealloc_zombie] + 150
9 libobjc.A.dylib 0x000000010b492afe _ZN11objc_object17sidetable_releaseEb + 232
10 libobjc.A.dylib 0x000000010b47d7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
11 libobjc.A.dylib 0x000000010b488332 objc_destructInstance + 93
12 CoreFoundation 0x000000010ba0cf76 -[NSObject(NSObject) __dealloc_zombie] + 150
13 libobjc.A.dylib 0x000000010b492afe _ZN11objc_object17sidetable_releaseEb + 232
14 WikitudeSDK 0x0000000104be0e88 -[WTARchitectManager .cxx_destruct] + 26
15 libobjc.A.dylib 0x000000010b47d7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
16 libobjc.A.dylib 0x000000010b488332 objc_destructInstance + 93
17 CoreFoundation 0x000000010ba0cf76 -[NSObject(NSObject) __dealloc_zombie] + 150
18 WikitudeSDK 0x0000000104bda469 -[WTARchitectManager dealloc] + 662
19 libobjc.A.dylib 0x000000010b492afe _ZN11objc_object17sidetable_releaseEb + 232
20 WikitudeSDK 0x0000000104c241a2 -[WTArchitectView .cxx_destruct] + 43
21 libobjc.A.dylib 0x000000010b47d7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
22 libobjc.A.dylib 0x000000010b488332 objc_destructInstance + 93
23 CoreFoundation 0x000000010ba0cf76 -[NSObject(NSObject) __dealloc_zombie] + 150
24 UIKit 0x0000000107ad207d -[UIResponder dealloc] + 146
25 UIKit 0x0000000107953da8 -[UIView dealloc] + 1557
26 WikitudeSDK 0x0000000104c22a27 -[WTArchitectView dealloc] + 105
27 libobjc.A.dylib 0x000000010b4930b8 _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 488
28 CoreFoundation 0x000000010b8eb736 _CFAutoreleasePoolPop + 22
29 CoreFoundation 0x000000010b91eba1 __CFRunLoopRun + 2081
30 CoreFoundation 0x000000010b91e0f8 CFRunLoopRunSpecific + 488
31 GraphicsServices 0x000000010d247ad2 GSEventRunModal + 161
32 UIKit 0x00000001078bef09 UIApplicationMain + 171
33 0x000000010310b36c main + 220
34 libdyld.dylib 0x000000010bf4b92d start + 1
35 ??? 0x0000000000000001 0x0 + 1
libc++abi.dylib: terminating with uncaught exception of type NSException
On dealloc we also call removeObserver method. Only difference with sample app, sample app use storyboard, we are using .xib file for uiviewcontrooler, we connect WTArchitectView to .h file, works fine but after dealloc this crash occurres.
We also try to set some variables on dealloc, result is same
self.architectView.delegate = nil;
self.architectView = nil;
You can find uiviewcontroller .h .m and .xib file in attachment.
Please help us about crash.
[[NSNotificationCenter defaultCenter] removeObserver:self];
//self.architectView = nil;
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
/* Pause architect view rendering when this view is not visible anymore */
Thanks for quick response.
I tested it with an iOS 9.3 device and it was fine. It's a specific iOS Simulator issue related to the camera replacement video.
Just in case you didn't know: If you provide a camera replacement video, you can run image or object tracking on the simulator with augmentations rendered and callback called as on the device.
FYI : It's just happening with iOS 9.3 simulator. (maybe with iOS 9.3 real device also, but i did not test it with iPhone 9.3 real device yet)
We know why black screen seems on iOS simulator. It is expected behavior.
When we will test AR feature with demo, we are using real device, not simulator. So it is not a problem for us ;)
But we don't have any iPhone 9.3 device. So i recorded this video with simulator.
Once you've checked the simulator impl, we'll be happy to share your results with us.
Thx for the video! I would have never realised that you're using the iOS Simulator.
I'll check the simulator impl. again. Might be that there is a problem hidden somewhere.
FYI: You might have already realised that the iOS Simulator shows a black camera image and that Geo AR is not working as expected. For the camera you need to specify a video that should be used to replace the device camera. Simply add the video to your application bundle (you can remove it for the app store build) and specify the 'WTCameraReplacementVideoPath' key in your application .plist to define which video should be used (In an dictionary named 'WTSimulatorSettings').
For GeoAR you need to run your application on the device.
You can find crash video link here:
I tried to reproduce the crash on an iPad running iOS 9.3 but wasn't successful. Could you send us a video that shows all the steps you do to crash our SDK? Maybe I didn't do the same steps as you.
I am using WikitudeSDK_iOS_7-1-0_2017-09-20_19-21-52, latest sample. Build with Xcode 9.1
iOS deployment target 9.0.
Crash happens with iOS 9.3, not happened with 10.3 or 11.1. Just happening with iOS 9.3.
And good news, it is also happening with your sample project. You can try and debug. This one:
This seems indeed weird.
Which version of our SDK are you using and which iOS version are you running on your device?
Can you make sure that the -stop method of WTArchitectView was called before dealloc is called (Set a breakpoint in that line in Debug configuration)?
Are you using AR.VideoDrawables or AR.context.startVideoPlayer in your Architect World? If so, you could try to remove the usage temporarily to see if they have something to do with the problem.