PDA

View Full Version : [iOS] Swift 2.0 SKMaps mapView.clearAllOverlays() not working.



gabri15
18.09.2015, 23:37
Hello there.

I migrated my whole project today to swift 2.0 and iOS9 support and I hadn't great problems in making it work out of the box aside from an error in compile time which made me to disable Bitcode for the project because it wasn't in the SKMaps.framework.

Altough It's working everything fine (at first sight) the first bug I found is that the maps actually does't clear any overlay when mapView.clearAllOverlays() is called.

Regards.

gabri15
22.09.2015, 20:43
Hello there.

Actually there is major issues with SKMaps 2.5 with iOS9 and Swift 2.0. In some parts of the application, when is rendering a map which shows a Real Range the application freezes and doesn't respond until is hard closed. This is the traceback of the issue:


Thread : Crashed: com.apple.main-thread
0 Elby 0x00000001003a1d40 std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, void*>*) + 2424792
1 Elby 0x00000001003a1d4c std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, void*>*) + 2424804
2 Elby 0x00000001003a1d4c std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, void*>*) + 2424804
3 Elby 0x00000001003e914c opengl::GLProgram::~GLProgram() + 2716644
4 Elby 0x00000001003a1d4c std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, void*>*) + 2424804
5 Elby 0x00000001003e9320 opengl::GLProgram::~GLProgram() + 2717112
6 Elby 0x00000001003dedec opengl::detail::GLStateMachine::~GLStateMachine() + 2674820
7 Elby 0x00000001003dd978 opengl::detail::GLStateMachine::~GLStateMachine() + 2669584
8 libsystem_c.dylib 0x000000019768b7c4 __cxa_finalize_ranges + 428
9 libsystem_c.dylib 0x0000000197635f64 exit + 24
10 UIKit 0x00000001877c1650 +[_UIAlertManager hideAlertsForTermination] + 526
11 UIKit 0x00000001879d96d0 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForc eExit:transitionContext:completion:]_block_invoke1976 + 316
12 UIKit 0x00000001879dc844 _runAfterCACommitDeferredBlocks + 292
13 UIKit 0x00000001879e8de4 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
14 UIKit 0x00000001877251e4 _afterCACommitHandler + 96
15 CoreFoundation 0x0000000182193c30 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK _FUNCTION__ + 32
16 CoreFoundation 0x00000001821919d4 __CFRunLoopDoObservers + 372
17 CoreFoundation 0x0000000182191e04 __CFRunLoopRun + 928
18 CoreFoundation 0x00000001820c0dc0 CFRunLoopRunSpecific + 384
19 GraphicsServices 0x000000018d214088 GSEventRunModal + 180
20 UIKit 0x000000018779af60 UIApplicationMain + 204
21 Elby 0x00000001000890ac main (AppDelegate.swift:136)
22 libdyld.dylib 0x00000001975fa8b8 start + 4

Adela_Silvia
25.09.2015, 11:41
Our development team is investigating the issues with iOS 9. We'll let you know when we have updates.

dandronic
12.10.2015, 14:10
The 2.5.1 (out this week) fixes the clearAllOverlays() issue

gabri15
16.10.2015, 22:55
As you told me, the clearAllOverlays() issue is gone with the 2.5.1 SKMaps arrival.

Altough, some issues related with memory allocation and QuartzCore related are still there.

I post you the two frequently:


Thread : Fatal Exception: CALayerInvalidGeometry
0 CoreFoundation 0x0000000184e0cf5c __exceptionPreprocess
1 libobjc.A.dylib 0x0000000199a03f80 objc_exception_throw
2 CoreFoundation 0x0000000184e0cea4 -[NSException initWithCoder:]
3 QuartzCore 0x0000000189b5cbf0 CA::Layer::set_position(CA::Vec2<double> const&, bool)
4 QuartzCore 0x0000000189b5cb4c -[CALayer setPosition:]
5 QuartzCore 0x0000000189b5cae4 -[CALayer setFrame:]
6 UIKit 0x000000018a35b17c -[UIView(Geometry) setFrame:]
7 UIKit 0x000000018a371410 -[UIImageView _setViewGeometry:forMetric:]
8 SKMaps 0x0000000100e19598
9 SKMaps 0x0000000100e18cfc
10 SKMaps 0x0000000100e1ab6c
11 SKMaps 0x0000000100e46f2c
12 QuartzCore 0x0000000189bb2ba4 CA::Display::DisplayLinkItem::dispatch()
13 QuartzCore 0x0000000189bb2a58 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long)
14 IOKit 0x000000018609a018 IODispatchCalloutFromCFMessage
15 CoreFoundation 0x0000000184dae8e0 __CFMachPortPerform
16 CoreFoundation 0x0000000184dc4cdc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FU NCTION__
17 CoreFoundation 0x0000000184dc4414 __CFRunLoopDoSource1
18 CoreFoundation 0x0000000184dc216c __CFRunLoopRun
19 CoreFoundation 0x0000000184cf0dc0 CFRunLoopRunSpecific
20 GraphicsServices 0x000000018fe44088 GSEventRunModal
21 UIKit 0x000000018a3caf44 UIApplicationMain
22 Elby 0x00000001000c101c main (AppDelegate.swift:19)
23 libdyld.dylib 0x000000019a22e8b8 start

And


Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x0000000198ce71e0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000198db0f0c pthread_kill + 112
2 libsystem_c.dylib 0x0000000198c5ab78 abort + 140
3 libsystem_malloc.dylib 0x0000000198d14384 szone_size + 522
4 SKMaps 0x0000000101112e2c std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, void*>*) + 36
5 SKMaps 0x0000000101112e2c std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int>, void*>*) + 36
6 SKMaps 0x000000010115e1c0 opengl::GLProgram::~GLProgram() + 132
7 libsystem_pthread.dylib 0x0000000198db0f0c pthread_kill + 112
8 SKMaps 0x000000010115e36c opengl::GLProgram::~GLProgram() + 20
9 SKMaps 0x0000000101152ac4 opengl::detail::GLStateMachine::~GLStateMachine() + 48
10 SKMaps 0x00000001011517a8 opengl::detail::GLStateMachine::~GLStateMachine() + 20
11 libsystem_c.dylib 0x0000000198c5b7c4 __cxa_finalize_ranges + 428
12 libsystem_c.dylib 0x0000000198c05f64 exit + 24
13 UIKit 0x0000000188e7d634 +[_UIAlertManager hideAlertsForTermination] + 526
14 UIKit 0x00000001890956b4 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForc eExit:transitionContext:completion:]_block_invoke1976 + 316
15 UIKit 0x0000000189098828 _runAfterCACommitDeferredBlocks + 292
16 UIKit 0x00000001890a4dc8 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
17 UIKit 0x0000000188de11c8 _afterCACommitHandler + 96
18 CoreFoundation 0x000000018384fc30 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK _FUNCTION__ + 32
19 CoreFoundation 0x000000018384d9d4 __CFRunLoopDoObservers + 372
20 CoreFoundation 0x000000018384de04 __CFRunLoopRun + 928
21 CoreFoundation 0x000000018377cdc0 CFRunLoopRunSpecific + 384
22 GraphicsServices 0x000000018e8d0088 GSEventRunModal + 180
23 UIKit 0x0000000188e56f44 UIApplicationMain + 204
24 Elby 0x000000010011d014 main (AppDelegate.swift:19)
25 libdyld.dylib 0x0000000198bca8b8 start + 4

Regards.

Adela_Silvia
19.10.2015, 10:55
We will check this out. Thank you for reporting it.

gabri15
26.10.2015, 12:01
We will check this out. Thank you for reporting it.

How is this going? It's a matter of time to the application to crash due this kind of errors. Pretty blocking issue...

Adela_Silvia
28.10.2015, 16:28
Can you please provide more info in order to better understand the circumstances in which this happens? A code snippet/steps/local settings might be helpful. We tested the Swift Demo project but calling the clearAllOverlays() method doesn't causes a crash.

gabri15
28.10.2015, 17:08
Can you please provide more info in order to better understand the circumstances in which this happens? A code snippet/steps/local settings might be helpful. We tested the Swift Demo project but calling the clearAllOverlays() method doesn't causes a crash.

Hello.

As I told, the .clearAllOverlays() method was fixed and It's not causing the crashes.

The circumstances where this crashes happen are when any map is shown on screen and, I've not tested if this has some relation to the problem, in previous versions didn't happen, I'm using a singleton as the whole map instance in order to preserve data, and memory efficiency between different maps shown in the application.

As far as I've tested, this crashes only happen in real devices NOT attached to a debug session (which causes this to be hard to fix for me) so all the crash reports I posted before are from iTunesConnect Beta Crash Reports and Crashlytics sessions, and it's a matter of time to the app to crash due to this kind of errors.

Regards.

Adela_Silvia
29.10.2015, 16:04
Thank you for the reply.
We'll investigate it further and we'll get back as soon as we have some updates

gabri15
03.11.2015, 17:55
An update on this:

I tried to force this issue on simulator and while profiling in the Instruments app. Reached 6 minutes the app (while a map is shown on screen) the app just freezes. No memory leaks, just 98MB of allocated memory for the app. No clues of why this is happening...

Adela_Silvia
04.11.2015, 16:29
Thanks for the update. I've forwarded it to our development team.

Adela_Silvia
05.11.2015, 14:12
Unfortunately our developers didn't manged to reproduce the issue based only on this information.
In order to be able to help you: please use loggers inside the application and then sent is to us.
Describe also what were you doing at the moment of the crash and which settings, functionality have you used?

gabri15
06.11.2015, 15:51
Unfortunately our developers didn't manged to reproduce the issue based only on this information.
In order to be able to help you: please use loggers inside the application and then sent is to us.
Describe also what were you doing at the moment of the crash and which settings, functionality have you used?

Hello.

Can we talk about this issue in a more private way? If I have to send you my project to be able to reproduce the problem I wouldn't do it in a public way... Also, if you need some loggers, what kind of information should I register to help you?

Regards.

(email me at: jrevuelta@usal.es)