Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27459] iOS: App crashes when error happens in fetching location

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-10-15T14:22:05.000+0000
Affected Version/sRelease 8.1.0
Fix Version/sRelease 8.3.0
Componentsn/a
LabelsengSchedule, iOS
Reportersuhas.kumbhar
AssigneeVijay Singh
Created2019-10-07T20:47:27.000+0000
Updated2019-10-15T15:42:27.000+0000

Description

After upgrading to 8.2.0.GA. - App crashes as soon as I switch to Airplane mode - App crashes on app launch with same error Terminating app due to uncaught exception 'NSInvalidArgumentException' I have attached a sample app using geolocation. Code snipped is same as mentioned in documentation. This is iOS app. This is always reproducible. Xcode - 10.3 node - v10.16.3 Same code works fine if built with 8.0.1.GA Crashes if built with 8.2.0.GA Attached- 1. Screen recording of crash 2. Sample app project 3. Sample app ipa Crash log:

default	15:18:01.721620 -0500	GeolocationCrash	{"msg":"delivering locations to client's delegate", "self":"0x2824b8680", "delegate":"0x155d072b0"}
default	15:18:01.797652 -0500	GeolocationCrash	-[GeolocationModule fireEvent:withObject:errorCode:message:]: unrecognized selector sent to instance 0x155d072b0
default	15:18:01.797787 -0500	GeolocationCrash	[ERROR] Application received error: -[GeolocationModule fireEvent:withObject:errorCode:message:]: unrecognized selector sent to instance 0x155d072b0
    0   CoreFoundation                      0x00000001c2e649a0 8D0042D6-AED4-39A5-9EE6-10D9A4CCD8E3 + 1227168
    1   libobjc.A.dylib                     0x00000001c2b8d0a4 objc_exception_throw + 56
    2   CoreFoundation                      0x00000001c2d6843c 8D0042D6-AED4-39A5-9EE6-10D9A4CCD8E3 + 193596
    3   CoreFoundation                      0x00000001c2e68e08 8D0042D6-AED4-39A5-9EE6-10D9A4CCD8E3 + 1244680
    4   CoreFoundation                      0x00000001c2e6abec _CF_forwarding_prep_0 + 92
    5   GeolocationCrash                    0x0000000104f9888c GeolocationCrash + 346252
    6   CoreLocation                        0x00000001c5f8de0c CLClientStopVehicleHeadingUpdates + 72136
    7   CoreLocation                        0x00000001c5f774a4 CLClientInvalidate + 1400
    8   CoreFoundation                      0x00000001c2de2614 8D0042D6-AED<…>
default	15:18:01.797995 -0500	GeolocationCrash	*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GeolocationModule fireEvent:withObject:errorCode:message:]: unrecognized selector sent to instance 0x155d072b0'
*** First throw call stack:
(0x1c2e6498c 0x1c2b8d0a4 0x1c2d6843c 0x1c2e68e08 0x1c2e6abec 0x104f9888c 0x1c5f8de0c 0x1c5f774a4 0x1c2de2614 0x1c2de1db4 0x1c2ddd4ec 0x1c2ddc8bc 0x1ccc41328 0x1c6e716d4 0x104f48bd8 0x1c2c67460)
default	15:18:01.823594 -0500	backboardd	Connection removed: IOHIDEventSystemConnection uuid:FB3D98B9-260A-414D-81A4-762AFAC211FD pid:1891 process:GeolocationCrash type:Passive entitlements:0x0 caller:BackBoardServices: <redacted> + 380 attributes:{
    HighFrequency = 0;
    bundleID = "com.svm.TMXFieldServTest";
    pid = 1891;
} inactive:0 events:0 mask:0x0
default	15:18:01.838460 -0500	ReportCrash	cr_update: Parsing corpse data for process GeolocationCrash [pid 1891]

Attachments

FileDateSize
Crash_ScreenRecording.mov2019-10-07T20:45:32.000+00007377180
GeolocationCrash_8.2.ipa2019-10-07T20:46:01.000+00009146579
GeolocationCrash 10-7-19, 5-08 PM.crash2019-10-07T22:11:05.000+000068615
GeolocationCrashSampleAppCode.zip2019-10-07T20:45:52.000+00005710506

Comments

  1. Sharif AbuDarda 2019-10-07

    Hello, Can you please share the trace log of the crash? Thanks.
  2. suhas.kumbhar 2019-10-07

    I don't see any track logs in IDE after crash - I exported crash log from xcode - please check if this is what you want. [^GeolocationCrash 10-7-19, 5-08 PM.crash]
  3. suhas.kumbhar 2019-10-09

    just checking, is it being looked into?
  4. Vijay Singh 2019-10-09

    Test Case -
       var win = Ti.UI.createWindow();
       var btn = Ti.UI.createButton({
           title: 'Show Location'
       });
       
       btn.addEventListener('click', function() {    
           Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH;
           var whenInUsePermission = Ti.Geolocation.hasLocationPermissions(Ti.Geolocation.AUTHORIZATION_WHEN_IN_USE);
       	var alwaysPermission = Ti.Geolocation.hasLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS);
           if (whenInUsePermission || alwaysPermission) {
               getLocation();
            } else {
               Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {
                   if (e.success) {
                       getLocation();
                   } else {
                       alert('could not obtain location permissions');
                   }
               });
           }
       });
       
       win.add(btn);
       win.open();
       
       function getLocation() {
           Ti.Geolocation.addEventListener('location', function(e) {
               alert(JSON.stringify(e, null, 2));
           });
       }
       
  5. Vijay Singh 2019-10-09

    PR - https://github.com/appcelerator/titanium_mobile/pull/11273
  6. Sohail Saddique 2019-10-14

    FR: Passed. I have confirmed that this issue affects > iOS 12. This does not affect < iOS 12. PR Merged. *Test Environment* Studio Ver: 5.1.4.201909061933 SDK Ver: 8.3.0 (PR-11273) OS Ver: 10.14.6 Xcode Ver: Xcode 11.1 Appc NPM: 4.2.15 Appc CLI: 7.1.1 Alloy Ver: 1.14.1 Node Ver: 10.16.3 NPM Ver: 6.11.3 Devices: iPhone 7 (iOS 13), iPhone 6 (iOS 12), iPhone 6 (iOS 11)
  7. Sohail Saddique 2019-10-15

    Verified with build: 8.3.0.v20191015062903. Ticked closed.
  8. suhas.kumbhar 2019-10-15

    Thanks

JSON Source