[TIMOB-20133] Map annotations crash in 5.1.1
| GitHub Issue | n/a | 
|---|---|
| Type | Bug | 
| Priority | High | 
| Status | Closed | 
| Resolution | Fixed | 
| Resolution Date | 2015-12-15T19:05:17.000+0000 | 
| Affected Version/s | n/a | 
| Fix Version/s | Release 5.1.2 | 
| Components | iOS | 
| Labels | regression | 
| Reporter | Rick Blalock | 
| Assignee | Chee Kiat Ng | 
| Created | 2015-12-11T16:21:45.000+0000 | 
| Updated | 2020-01-13T19:57:38.000+0000 | 
Description
	On iOS, the following code crashes the app:
var position = Alloy.Globals.Map.createAnnotation({
    latitude: newPosition.latitude,
    longitude: newPosition.longitude,
    title: "Position",
    subtitle: "some title",
    pincolor: Alloy.Globals.Map.ANNOTATION_GREEN
});
$.map.addAnnotation(position);
pincolor: Alloy.Globals.Map.ANNOTATION_GREEN .  For some reason the GREEN annotation constant crashes.
Here's the crash log:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                   0x0000000112cf1d0d objc_retain + 13
1   com.fishrulesapp.fishrules        0x000000010dc0038e -[TiMapView mapView:viewForAnnotation:] + 649 (TiMapView.m:983)
2   com.apple.MapKit                  0x000000010e359647 -[MKMapView annotationManager:representationForAnnotation:] + 308
3   com.apple.MapKit                  0x000000010e3c9972 -[MKAnnotationManager _addRepresentationForAnnotation:] + 355
4   com.apple.MapKit                  0x000000010e3c913a -[MKAnnotationManager updateVisibleAnnotations] + 1551
5   com.apple.MapKit                  0x000000010e3493be -[MKMapView _didChangeRegionMidstream:] + 232
6   com.apple.MapKit                  0x000000010e34e000 -[MKMapView mapLayer:didChangeRegionAnimated:] + 81
7   com.apple.VectorKit               0x000000011d5624b5 __86-[VKMapCameraController _animateToPosition:pitch:yaw:duration:timingCurve:completion:]_block_invoke349 + 37
8   com.apple.VectorKit               0x000000011d51483e -[VKAnimation stopAnimation:] + 110
9   com.apple.VectorKit               0x000000011d514cf0 -[VKTimedAnimation stopAnimation:] + 48
10  com.apple.VectorKit               0x000000011d5606aa -[VKMapCameraController _animateToPosition:pitch:yaw:duration:timingCurve:completion:] + 106
11  com.apple.VectorKit               0x000000011d560603 -[VKMapCameraController animateToMapRegion:pitch:yaw:duration:completion:] + 723
12  com.apple.MapKit                  0x000000010e35446a -[MKMapView _goToMapRegion:duration:animated:completionHandler:] + 350
13  com.apple.MapKit                  0x000000010e3541f9 -[MKMapView _setZoomScale:centerMapPoint:duration:animated:] + 598
14  com.apple.MapKit                  0x000000010e35604f -[MKMapView _goToCenterCoordinate:zoomLevel:animated:] + 1577
15  com.apple.MapKit                  0x000000010e3537ec -[MKMapView setRegion:animated:] + 402
16  com.fishrulesapp.fishrules        0x000000010dbfb0f6 -[TiMapView render] + 550 (TiMapView.m:62)
17  com.fishrulesapp.fishrules        0x000000010d6c546e __DoProxyDelegateChangedValuesWithProxy_block_invoke54 + 46 (TiProxy.m:92)
18  com.fishrulesapp.fishrules        0x000000010d702dd4 __TiThreadPerformOnMainThread_block_invoke + 52 (TiBase.m:287)
19  com.fishrulesapp.fishrules        0x000000010d70317a TiThreadProcessPendingMainThreadBlocks + 410 (TiBase.m:399)
20  com.fishrulesapp.fishrules        0x000000010d702fd3 __TiThreadPerformOnMainThread_block_invoke216 + 35 (TiBase.m:326)
21  libdispatch.dylib                 0x0000000116dcbd59 _dispatch_call_block_and_release + 12
22  libdispatch.dylib                 0x0000000116de74a7 _dispatch_client_callout + 8
23  libdispatch.dylib                 0x0000000116dd1f2d _dispatch_main_queue_callback_4CF + 714
24  com.apple.CoreFoundation          0x000000011326cd09 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
25  com.apple.CoreFoundation          0x000000011322e2c9 __CFRunLoopRun + 2073
26  com.apple.CoreFoundation          0x000000011322d828 CFRunLoopRunSpecific + 488
27  com.apple.GraphicsServices        0x0000000113fcdad2 GSEventRunModal + 161
28  com.apple.UIKit                   0x000000010fabe610 UIApplicationMain + 171
29  com.fishrulesapp.fishrules        0x000000010d5ec3d6 main + 310 (main.m:37)
30  libdyld.dylib                     0x0000000116e1692d start + 1
Verified as fixed, see above duplicate ticket for more information. Using map module 2.5.2 fixes this issue. Tested on: iPhone 6s Plus Device (9.2) & Simulators (9.1) Mac OSX El Capitan 10.11 (15A284) Studio: 4.4.0.201511241829 Ti SDK: 5.1.2.v20151214111649 Appc NPM: 4.2.2 App CLI: 5.1.0 Xcode 7.2 Node v4.2.3 production *Closing ticket.*