[TIMOB-27958] Ti.Geolocation.reverseGeocoder() crashes the app on iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-08-06T10:53:48.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.1.0 |
Components | n/a |
Labels | Crash, ios, iphone |
Reporter | Ferdinando Traversa |
Assignee | Vijay Singh |
Created | 2020-06-08T17:50:06.000+0000 |
Updated | 2021-02-17T11:36:29.000+0000 |
Description
When I use Ti.Geolocation.reverseGeocoder() function in any manner or way (for example:
Ti.Geolocation.reverseGeocoder(response.latitude, response.longitude, function (e) {
if (e.success) {
$.address.show();
$.address.text = e.places[0].address;
} else {
$.address.hide();
}
});
or, more simpler:
Ti.Geolocation.reverseGeocoder(25, 10, function (e) {});
the iOS application crashes. On Android, there's no crash and the *geocode works perfectly*.
Here is the crash log:
[ERROR] Script Error {
[ERROR] column = 37;
[ERROR] line = 139;
[ERROR] message = "*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[5]";
[ERROR] nativeStack = (
[ERROR] 0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350
[ERROR] 1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48
[ERROR] 2 CoreFoundation 0x00007fff23ecfa51 _CFThrowFormattedException + 194
[ERROR] 3 CoreFoundation 0x00007fff23eda4a6 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38
[ERROR] 4 CoreFoundation 0x00007fff23e9b787 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247
[ERROR] 5 CoreFoundation 0x00007fff23e38e11 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49
[ERROR] 6 WLM Italia 0x000000010df4adba -[GeolocationModule performGeo:address:callback:] + 394
[ERROR] 7 WLM Italia 0x000000010df4aeb4 -[GeolocationModule reverseGeocoder:longitude:withCallback:] + 164
[ERROR] 8 CoreFoundation 0x00007fff23e43e8c __invoking___ + 140
[ERROR] 9 CoreFoundation 0x00007fff23e41071 -[NSInvocation invoke] + 321
[ERROR] 10 JavaScriptCore 0x00007fff26c823bb _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 411
[ERROR] 11 JavaScriptCore 0x00007fff26c81de7 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 231
[ERROR] 12 JavaScriptCore 0x00007fff26c8158f _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_14JSGlobalObjectEPNS_9CallFrameE + 575
[ERROR] 13 ??? 0x000030a99ba13527 0x0 + 53505018639655
[ERROR] 14 JavaScriptCore 0x00007fff26c4e74d llint_entry + 93344
[ERROR] 15 JavaScriptCore 0x00007fff26c378ff vmEntryToJavaScript + 200
[ERROR] 16 JavaScriptCore 0x00007fff2706e6d5 _ZN3JSC11Interpreter11executeCallEPNS_14JSGlobalObjectEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 549
[ERROR] 17 JavaScriptCore 0x00007fff272a898a _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 170
[ERROR] 18 JavaScriptCore 0x00007fff26c9f75c JSObjectCallAsFunction + 620
[ERROR] 19 TitaniumKit 0x000000010e2d3886 __65-[KrollObject invokeCallbackForKey:withObject:thisObject:onDone:]_block_invoke + 424
[ERROR] 20 libdispatch.dylib 0x00007fff519e2951 _dispatch_call_block_and_release + 12
[ERROR] 21 libdispatch.dylib 0x00007fff519e38cb _dispatch_client_callout + 8
[ERROR] 22 libdispatch.dylib 0x00007fff519efcdb _dispatch_main_queue_callback_4CF + 1042
[ERROR] 23 CoreFoundation 0x00007fff23da0909 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
[ERROR] 24 CoreFoundation 0x00007fff23d9b459 __CFRunLoopRun + 2041
[ERROR] 25 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
[ERROR] 26 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
[ERROR] 27 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
[ERROR] 28 WLM Italia 0x000000010dd87d35 main + 1173
[ERROR] 29 libdyld.dylib 0x00007fff51a231fd start + 1
[ERROR] );
[ERROR] sourceURL = undefined;
[ERROR] stack = "[native code]\nonload";
[ERROR] }
[ERROR] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[5]'
[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 0x00007fff23ecfa51 _CFThrowFormattedException + 194
[ERROR] 3 CoreFoundation 0x00007fff23eda4a6 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38
[ERROR] 4 CoreFoundation 0x00007fff23e9b787 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247
[ERROR] 5 CoreFoundation 0x00007fff23e38e11 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49
[ERROR] 6 WLM Italia 0x000000010df4adba -[GeolocationModule performGeo:address:callback:] + 394
[ERROR] 7 WLM Italia 0x000000010df4aeb4 -[GeolocationModule reverseGeocoder:longitude:withCallback:] + 164
[ERROR] 8 CoreFoundation 0x00007fff23e43e8c __invoking___ + 140
[ERROR] 9 CoreFoundation 0x00007fff23e41071 -[NSInvocation invoke] + 321
[ERROR] 10 JavaScriptCore 0x00007fff26c823bb _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 411
[ERROR] 11 JavaScriptCore 0x00007fff26c81de7 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 231
[ERROR] 12 JavaScriptCore 0x00007fff26c8158f _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_14JSGlobalObjectEPNS_9CallFrameE + 575
[ERROR] 13 ??? 0x000030a99ba13527 0x0 + 53505018639655
[ERROR] 14 JavaScriptCore 0x00007fff26c4e74d llint_entry + 93344
[ERROR] 15 JavaScriptCore 0x00007fff26c378ff vmEntryToJavaScript + 200
[ERROR] 16 JavaScriptCore 0x00007fff2706e6d5 _ZN3JSC11Interpreter11executeCallEPNS_14JSGlobalObjectEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 549
[ERROR] 17 JavaScriptCore 0x00007fff272a898a _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 170
[ERROR] 18 JavaScriptCore 0x00007fff26c9f75c JSObjectCallAsFunction + 620
[ERROR] 19 TitaniumKit 0x000000010e2d3886 __65-[KrollObject invokeCallbackForKey:withObject:thisObject:onDone:]_block_invoke + 424
[ERROR] 20 libdispatch.dylib 0x00007fff519e2951 _dispatch_call_block_and_release + 12
[ERROR] 21 libdispatch.dylib 0x00007fff519e38cb _dispatch_client_callout + 8
[ERROR] 22 libdispatch.dylib 0x00007fff519efcdb _dispatch_main_queue_callback_4CF + 1042
[ERROR] 23 CoreFoundation 0x00007fff23da0909 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
[ERROR] 24 CoreFoundation 0x00007fff23d9b459 __CFRunLoopRun + 2041
[ERROR] 25 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
[ERROR] 26 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
[ERROR] 27 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
[ERROR] 28 WLM Italia 0x000000010dd87d35 main + 1173
[ERROR] 29 libdyld.dylib 0x00007fff51a231fd start + 1
[ERROR] )
[ERROR] libc++abi.dylib: terminating with uncaught exception of type NSException
Checked & I could not reproduce this. Works for me. Probably a reproducible case will be helpful.
It seems, it only happens on iPad for me. The same code works on iphone without any problems
{noformat} [INFO] has permission [INFO] getCurrentPosition success true [INFO] do reverseGeocoder [ERROR] Script Error { [ERROR] column = 39; [ERROR] line = 643; [ERROR] message = "*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[5]"; [ERROR] nativeStack = ( [ERROR] 0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350 [ERROR] 1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48 [ERROR] 2 CoreFoundation 0x00007fff23ecfa51 _CFThrowFormattedException + 194 [ERROR] 3 CoreFoundation 0x00007fff23eda4a6 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38 [ERROR] 4 CoreFoundation 0x00007fff23e9b787 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247 [ERROR] 5 CoreFoundation 0x00007fff23e38e11 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49 [ERROR] 6 Systemhaus 0x0000000108e3a26a -[GeolocationModule performGeo:address:callback:] + 394 [ERROR] 7 Systemhaus 0x0000000108e3a364 -[GeolocationModule reverseGeocoder:longitude:withCallback:] + 164 [ERROR] 8 CoreFoundation 0x00007fff23e43e8c __invoking___ + 140 [ERROR] 9 CoreFoundation 0x00007fff23e41071 -[NSInvocation invoke] + 321 [ERROR] 10 JavaScriptCore 0x00007fff26c823bb _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 411 [ERROR] 11 JavaScriptCore 0x00007fff26c81de7 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 231 [ERROR] 12 JavaScriptCore 0x00007fff26c8158f _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_14JSGlobalObjectEPNS_9CallFrameE + 575 [ERROR] 13 ??? 0x0000336698601027 0x0 + 56515736113191 [ERROR] 14 JavaScriptCore 0x00007fff26c4e74d llint_entry + 93344 [ERROR] 15 JavaScriptCore 0x00007fff26c378ff vmEntryToJavaScript + 200 [ERROR] 16 JavaScriptCore 0x00007fff2706e6d5 _ZN3JSC11Interpreter11executeCallEPNS_14JSGlobalObjectEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 549 [ERROR] 17 JavaScriptCore 0x00007fff272a898a _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 170 [ERROR] 18 JavaScriptCore 0x00007fff26c9f75c JSObjectCallAsFunction + 620 [ERROR] 19 JavaScriptCore 0x00007fff26c62ebc -[JSValue callWithArguments:] + 252 [ERROR] 20 TitaniumKit 0x00000001092acdac -[ObjcProxy _fireEventToListener:withObject:listener:] + 291 [ERROR] 21 Systemhaus 0x0000000108e3d209 -[GeolocationModule fireSingleShotLocationIfNeeded:stopIfNeeded:] + 441 [ERROR] 22 Systemhaus 0x0000000108e3dfbf -[GeolocationModule locationManager:didUpdateLocations:] + 287 [ERROR] 23 CoreLocation 0x00007fff24a277a7 CLClientStopVehicleHeadingUpdates + 71699 [ERROR] 24 CoreLocation 0x00007fff24a26f10 CLClientStopVehicleHeadingUpdates + 69500 [ERROR] 25 CoreLocation 0x00007fff24a1144e CLClientInvalidate + 1479 [ERROR] 26 CoreFoundation 0x00007fff23da0b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12 [ERROR] 27 CoreFoundation 0x00007fff23da0253 __CFRunLoopDoBlocks + 195 [ERROR] 28 CoreFoundation 0x00007fff23d9b043 __CFRunLoopRun + 995 [ERROR] 29 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404 [ERROR] 30 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139 [ERROR] 31 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605 [ERROR] 32 Systemhaus 0x0000000108c771e2 main + 1170 [ERROR] 33 libdyld.dylib 0x00007fff51a231fd start + 1 [ERROR] 34 ??? 0x0000000000000001 0x0 + 1 [ERROR] ); [ERROR] sourceURL = undefined; [ERROR] stack = "[native code]\n"; [ERROR] } [ERROR] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[5]' [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 0x00007fff23ecfa51 _CFThrowFormattedException + 194 [ERROR] 3 CoreFoundation 0x00007fff23eda4a6 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38 [ERROR] 4 CoreFoundation 0x00007fff23e9b787 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247 [ERROR] 5 CoreFoundation 0x00007fff23e38e11 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49 [ERROR] 6 Systemhaus 0x0000000108e3a26a -[GeolocationModule performGeo:address:callback:] + 394 [ERROR] 7 Systemhaus 0x0000000108e3a364 -[GeolocationModule reverseGeocoder:longitude:withCallback:] + 164 [ERROR] 8 CoreFoundation 0x00007fff23e43e8c __invoking___ + 140 [ERROR] 9 CoreFoundation 0x00007fff23e41071 -[NSInvocation invoke] + 321 [ERROR] 10 JavaScriptCore 0x00007fff26c823bb _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 411 [ERROR] 11 JavaScriptCore 0x00007fff26c81de7 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 231 [ERROR] 12 JavaScriptCore 0x00007fff26c8158f _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_14JSGlobalObjectEPNS_9CallFrameE + 575 [ERROR] 13 ??? 0x0000336698601027 0x0 + 56515736113191 [ERROR] 14 JavaScriptCore 0x00007fff26c4e74d llint_entry + 93344 [ERROR] 15 JavaScriptCore 0x00007fff26c378ff vmEntryToJavaScript + 200 [ERROR] 16 JavaScriptCore 0x00007fff2706e6d5 _ZN3JSC11Interpreter11executeCallEPNS_14JSGlobalObjectEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 549 [ERROR] 17 JavaScriptCore 0x00007fff272a898a _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 170 [ERROR] 18 JavaScriptCore 0x00007fff26c9f75c JSObjectCallAsFunction + 620 [ERROR] 19 JavaScriptCore 0x00007fff26c62ebc -[JSValue callWithArguments:] + 252 [ERROR] 20 TitaniumKit 0x00000001092acdac -[ObjcProxy _fireEventToListener:withObject:listener:] + 291 [ERROR] 21 Systemhaus 0x0000000108e3d209 -[GeolocationModule fireSingleShotLocationIfNeeded:stopIfNeeded:] + 441 [ERROR] 22 Systemhaus 0x0000000108e3dfbf -[GeolocationModule locationManager:didUpdateLocations:] + 287 [ERROR] 23 CoreLocation 0x00007fff24a277a7 CLClientStopVehicleHeadingUpdates + 71699 [ERROR] 24 CoreLocation 0x00007fff24a26f10 CLClientStopVehicleHeadingUpdates + 69500 [ERROR] 25 CoreLocation 0x00007fff24a1144e CLClientInvalidate + 1479 [ERROR] 26 CoreFoundation 0x00007fff23da0b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12 [ERROR] 27 CoreFoundation 0x00007fff23da0253 __CFRunLoopDoBlocks + 195 [ERROR] 28 CoreFoundation 0x00007fff23d9b043 __CFRunLoopRun + 995 [ERROR] 29 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404 [ERROR] 30 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139 [ERROR] 31 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605 [ERROR] 32 Systemhaus 0x0000000108c771e2 main + 1170 [ERROR] 33 libdyld.dylib 0x00007fff51a231fd start + 1 [ERROR] 34 ??? 0x0000000000000001 0x0 + 1 [ERROR] ) [ERROR] libc++abi.dylib: terminating with uncaught exception of type NSException {noformat}
I have the same issue on iPhone simulator.
Same for me in iPhone simulator 11 (13.5). Didn't test it on device
Added a PR [here](https://github.com/appcelerator/titanium_mobile/pull/11772).
Hey Guys, Is there any specific scenario in which countryCode is coming 'nil', which is causing crash? I tried to test at my end but unable to reproduce it.
@Vijay Singh, simply using the code I wrote, it crashes in the emulator at least.
I‘m from Germany
I’m from Italy
[~benutzername] [~ferdi.traversa] Can you try to verify it with PR https://github.com/appcelerator/titanium_mobile/pull/11772 , if crash is resolved. We are not able to reproduce it at our end. Thanks!
I cannot access https://jenkins.appcelerator.org/job/titanium-sdk/job/titanium_mobile/job/PR-11772/5/artifact/dist/mobilesdk-9.1.0.v20200617110039-osx.zip and it's not on http://builds.appcelerator.com.s3.amazonaws.com/index.html#master
[~benutzername] Thanks for your quick action. You can download SDK from [here](https://www.dropbox.com/s/qm1wilw20juqoh0/9.1.0.v20200617110039.zip?dl=0) and unzip it at location /Users/user-name/Library/Application Support/Titanium/mobilesdk/osx/ . Update the sdk-version in tiapp.xml and run. Thanks!
Thank you. I can confirm, that with 9.1.0.v20200617110039 the Ti.Geolocation.reverseGeocoder works as expected
Thanks [~benutzername] .
FR Passed: Waiting on Jenkins build.
merged to master for 9.1.0 target
Fix verified on build 9.1.0.v20200804082025. Closing ticket.