Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2816] iOS: circle on ti.map crashes app

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-01-14T12:39:51.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.3.1
ComponentsiOS
Labelsti.map
ReporterVDLP
AssigneeVijay Singh
Created2020-10-29T09:33:54.000+0000
Updated2021-01-14T12:39:51.000+0000

Description

Hello, When drawing a circle on a ti.map view the app crashes unexpectedly. Often the first draw is succesfull but after that the app crashes. We're running titanium sdk 8.3.1.GA & ti.map 3.4.0. Exception:
[INFO]  loadLocation
[INFO]  -[NSConcreteValue boundBridge:withKrollObject:]: unrecognized selector sent to instance 0x600002014f60
[ERROR] Script Error {
[ERROR]     nativeStack = "3   CoreFoundation  0x00007fff23e4190c ___forwarding___ + 1436\n4   CoreFoundation  0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120\n5   TitaniumKit0x0000000103d3d658 -[KrollBridge registerProxy:] + 137\n6   TitaniumKit0x0000000103d1ed40 TiBindingTiValueFromProxy + 460\n7   TitaniumKit0x0000000103d36ecd KrollGetProperty + 668\n8   JavaScriptCore  0x00007fff26c916d7 _ZN3JSC16JSCallbackObjectINS_16JSNonFinalObjectEE14callbackGetterEPNS_14JSGlobalObjectExNS_12PropertyNameE + 231\n9   JavaScriptCore  0x00007fff27151470 llint_slow_path_get_by_id + 2000\n10  JavaScriptCore  0x00007fff26c403a3 llint_entry + 35062\n11  JavaScriptCore  0x00007fff26c378ff vmEntryToJavaScript + 200\n12  JavaScriptCore  0x00007fff2706e6d5 _ZN3JSC11Interpreter11executeCallEPNS_14JSGlobalObjectEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 549\n13  JavaScriptCore  0x00007fff272a898a _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 170\n14  JavaScriptCore  0x00007fff26c9f75c JSObjectCallAsFunction + 620\n15  TitaniumKit0x0000000103d53c2b TiBindingEventProcess + 667\n16  TitaniumKit0x0000000103d7447c -[KrollContext invoke:] + 109\n17  TitaniumKit0x0000000103d744ef -[KrollContext enqueue:] + 93\n18  TitaniumKit0x0000000103d7ba8e TiBindingRunLoopEnqueue + 77\n19  TitaniumKit0x0000000103d7a2e4 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 164\n20  TitaniumKit0x0000000103d5bcec -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224\n21  tabgrouptest    0x00000001037091f0 -[TiUIButtonProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 272\n22  TitaniumKit0x0000000103d7a00f -[TiProxy fireEvent:withObject:] + 72";
[ERROR]     toJSON = "<KrollCallback: 0x60000262eb80>";
[ERROR] } 
[ERROR] -[__NSCFString count]: unrecognized selector sent to instance 0x7f86c0151400
[ERROR] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString count]: unrecognized selector sent to instance 0x7f86c0151400'
[ERROR] *** First throw call stack:
[ERROR] ( 
[ERROR]         0   CoreFoundation                      0x00007fff23e3cf0e __exceptionPreprocess + 350
[ERROR]         1   libobjc.A.dylib                     0x00007fff50ba89b2 objc_exception_throw + 48
[ERROR]         2   CoreFoundation                      0x00007fff23e5dc34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
[ERROR]         3   CoreFoundation                      0x00007fff23e4190c ___forwarding___ + 1436
[ERROR]         4   CoreFoundation                      0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120
[ERROR]         5   TitaniumKit                         0x0000000103d66b79 -[TiExceptionHandler showScriptError:] + 149
[ERROR]         6   TitaniumKit                         0x0000000103d53c88 TiBindingEventProcess + 760
[ERROR]         7   TitaniumKit                         0x0000000103d7447c -[KrollContext invoke:] + 109
[ERROR]         8   TitaniumKit                         0x0000000103d744ef -[KrollContext enqueue:] + 93
[ERROR]         9   TitaniumKit                         0x0000000103d7ba8e TiBindingRunLoopEnqueue + 77
[ERROR]         10  TitaniumKit                         0x0000000103d7a2e4 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 164
[ERROR]         11  TitaniumKit                         0x0000000103d5bcec -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224
[ERROR]         12  tabgrouptest                        0x00000001037091f0 -[TiUIButtonProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 272
[ERROR]         13  TitaniumKit                         0x0000000103d7a00f -[TiProxy fireEvent:withObject:] + 72
[ERROR]         14  tabgrouptest                        0x000000010370b64e -[TiUIButton controlAction:forEvent:] + 686
[ERROR]         15  UIKitCore                           0x00007fff48c8cca1 -[UIApplication sendAction:to:from:forEvent:] + 83
[ERROR]         16  UIKitCore                           0x00007fff4863bcde -[UIControl sendAction:to:forEvent:] + 223
[ERROR]         17  UIKitCore                           0x00007fff4863c026 -[UIControl _sendActionsForEvents:withEvent:] + 396
[ERROR]         18  UIKitCore                           0x00007fff4863af97 -[UIControl touchesEnded:withEvent:] + 497
[ERROR]         19  UIKitCore                           0x00007fff48cc858c -[UIWindow _sendTouchesForEvent:] + 1359
[ERROR]         20  UIKitCore                           0x00007fff48cca311 -[UIWindow sendEvent:] + 4501
[ERROR]         21  UIKitCore                           0x00007fff48ca4755 -[UIApplication sendEvent:] + 356
[ERROR]         22  UIKit                               0x0000000105b830b8 -[UIApplicationAccessibility sendEvent:] + 85
[ERROR]         23  tabgrouptest                        0x00000001036f5ab1 -[TiUIApplication sendEvent:] + 577
[ERROR]         24  UIKitCore                           0x00007fff48d2f552 __dispatchPreprocessedEventFromEventQueue + 7628
[ERROR]         25  UIKitCore                           0x00007fff48d32716 __handleEventQueueInternal + 6584
[ERROR]         26  UIKitCore                           0x00007fff48d28fb9 __handleHIDEventFetcherDrain + 88
[ERROR]         27  CoreFoundation                      0x00007fff23da0d31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
[ERROR]         28  CoreFoundation                      0x00007fff23da0c5c __CFRunLoopDoSource0 + 76
[ERROR]         29  CoreFoundation                      0x00007fff23da0434 __CFRunLoopDoSources0 + 180
[ERROR]         30  CoreFoundation                      0x00007fff23d9b02e __CFRunLoopRun + 974
[ERROR]         31  CoreFoundation                      0x00007fff23d9a944 CFRunLoopRunSpecific + 404
[ERROR]         32  GraphicsServices                    0x00007fff38ba6c1a GSEventRunModal + 139
[ERROR]         33  UIKitCore                           0x00007fff48c8b9ec UIApplicationMain + 1605
[ERROR]         34  tabgrouptest                        0x000000010366d892 main + 1170
[ERROR]         35  libdyld.dylib                       0x00007fff51a231fd start + 1
[ERROR]         36  ???                                 0x0000000000000001 0x0 + 1
[ERROR] ) 
[ERROR] libc++abi.dylib: terminating with uncaught exception of type NSException
index.js
var map = require('ti.map');
let location = {
    latitude: 52.965151,
    longitude: 5.913073,
    pivot: {
        range: 1000
    }
};

let annotations = {
    locationRadius: null
};

function onMapComplete() {
    console.log('onMapComplete')
    loadLocation();
}

function loadLocation() {
    console.log('loadLocation');

    var locationRadiusChanged = annotations.locationRadius === null
        || annotations.locationRadius.radius !== location.pivot.range
        || annotations.locationRadius.center.latitude !== location.latitude
        || annotations.locationRadius.center.longitude !== location.longitude;

    if (locationRadiusChanged) {
        
        if(annotations.locationRadius !== null) {
            $.map.removeCircle(annotations.locationRadius);
        }

        annotations.locationRadius = map.createCircle({
            center: {
                latitude: location.latitude,
                longitude: location.longitude
            },
            fillColor: 'transparent',
            strokeColor: '#22c064',
            strokeWidth: 5,
            radius: location.pivot.range
        });

        $.map.addCircle(annotations.locationRadius);
    }
}

$.index.open();
index.xml
<Alloy>
	<Window id="index" layout="absolute">
		<Module top="0" bottom="200" id="map" module="ti.map" onComplete="onMapComplete"
				method="createView" />
				
				<Button left="0" right="0" bottom="0" onClick="loadLocation">Update Location</Button>
	</Window>
</Alloy>

Operating System
  Name                        = Mac OS X
  Version                     = 10.15.6
  Architecture                = 64bit
  # CPUs                      = 8
  Memory                      = 17179869184

Node.js
  Node.js Version             = 12.9.0
  npm Version                 = 6.14.8

Titanium CLI
  CLI Version                 = 5.2.5

Titanium SDK
  SDK Version                 = 8.3.1.GA
  SDK Path                    = /Users/vdlp/Library/Application Support/Titanium/mobilesdk/osx/8.3.1.GA
  Target Platform             = iphone

Comments

  1. Vijay Singh 2020-11-30

    PR - https://github.com/appcelerator-modules/ti.map/pull/366

JSON Source