Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2800] iPhone : crash when trying to get a contact email (contacts synchronized)

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionDuplicate
Resolution Date2011-04-15T03:29:54.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-11
ComponentsiOS
Labelscontacts, defect, ios, rplist
ReporterGuillaume
AssigneeReggie Seagraves
Created2011-04-15T03:29:49.000+0000
Updated2017-03-03T06:37:06.000+0000

Description

When we synchronize contacts with external systems such as google, the email labels are not set correctly.
Instead of having 'home', 'work', 'other' labels, we get 'email' emails.

Then if we get a contact using:

 selectedContact = Titanium.Contacts.getPeopleWithName(contactName);

and then try to get the emails by doing :

 var emails = selectedContact[0].email;
Then, the app crashes.

Comments

  1. Pedro Enrique 2011-04-15

    There is a HD ticket that encountered the same issue when using a MS Exchange contact.

    According to the crash log, it was using Ti SDK 1.5.1

    http://developer.appcelerator.com/helpdesk/view/68441">http://developer.appcelerator.com/helpdesk/view/68441

  2. tom quas 2011-04-15

    This issue holds us from rolling out our app. Need access to email for address sync. Please prioritize accordingly.

  3. John Hass 2011-04-15

    Any word on this ticket? It has put our development at a complete halt.

  4. tom quas 2011-04-15

    I desperately need a solution, too. Filing this once more on the helpdesk...

  5. Stephen Tramer 2011-04-15

    Requires more details. May not be a bug; could just be a developer issue where Contacts is not being used correctly.

  6. Guillaume 2011-04-15

    Hi,
    What kind of details would you need ? We can try to provide more info.
    Basically, the exact same code works when retrieving phones. It does work with emails when contacts have not been synchronised with external systems (and thus with the correct labels). It does not when the email label is "email".

    let us know.
    Thanks for working on this.

  7. tom quas 2011-04-15

    I just tested w/ Kitchensink, here is what happens:

    Scenario #1: Have a contact with this (internationally valid) mobile phone number format: 00491702345678

    Scenario #2: Have a contact with this (internationally valid) mobile phone number format: +491702345678

    On iOS, go to KitchenSink > Contacts > Contacts picker.
    Turn off 'addresss only'.
    Click 'show picker'

    Whereas scenario #2 works, #1 bombs with the exception below:

    [ERROR] The application has crashed with an unhandled exception. Stack trace: 0 CoreFoundation 0x022d9bcc exceptionPreprocess + 156
    1 libobjc.A.dylib 0x0242e5c2 objc_exception_throw + 47
    2 CoreFoundation 0x02292628 +[NSException raise:format:arguments:] + 136
    3 CoreFoundation 0x0229259a +[NSException raise:format:] + 58
    4 QuartzCore 0x0190c96a ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 177
    5 QuartzCore 0x0190c8b5 -[CALayer setPosition:] + 42
    6 QuartzCore 0x0190c7cc -[CALayer setFrame:] + 763
    7 UIKit 0x008c1307 -[UIView(Geometry) setFrame:] + 255
    8 UIKit 0x009aca68 -[UILabel setFrame:] + 262
    9 AddressBookUI 0x0134615d -[ABPersonTableViewDataSource reloadNoValueLabelAnimated:] + 645
    10 AddressBookUI 0x0133e0a6 -[ABPersonTableViewDataSource reloadDataIncludingHeaderView:invalidatePropertyData:] + 318
    11 AddressBookUI 0x0133df62 -[ABPersonTableViewDataSource reloadDataIncludingHeaderView:] + 50
    12 AddressBookUI 0x0132878d -[ABPersonViewControllerHelper prepareViewWithDisplayedProperties:person:allowActions:] + 1195
    13 AddressBookUI 0x01322cee -[ABPersonViewControllerHelper loadViewWithDisplayedProperties:person:allowDeletion:allowActions:] + 68
    14 AddressBookUI 0x01319f1a -[ABPersonViewController loadView] + 144
    15 UIKit 0x009395e3 -[UIViewController view] + 56
    16 UIKit 0x00937a57 -[UIViewController contentScrollView] + 42
    17 UIKit 0x00948201 -[UINavigationController
    computeAndApplyScrollContentInsetDeltaForViewController:] + 48
    18 UIKit 0x00946831 -[UINavigationController layoutViewController:] + 43
    19 UIKit 0x00947b4c -[UINavigationController
    startTransition:fromViewController:toViewController:] + 524
    20 UIKit 0x00942606 -[UINavigationController startDeferredTransitionIfNeeded] + 266
    21 UIKit 0x0094983e -[UINavigationController pushViewController:transition:forceImmediate:] + 932
    22 UIKit 0x009424a0 -[UINavigationController pushViewController:animated:] + 62
    23 AddressBookUI 0x01312f79 -[ABPeoplePickerNavigationController pushViewController:animated:] + 162
    24 AddressBookUI 0x01314828 -[ABPeoplePickerNavigationController showCardForPerson:withMemberCell:animate:forceDisableEditing:personViewController:] + 1338
    25 AddressBookUI 0x01316d1d -[ABMembersViewController showCardForPerson:withMemberCell:animate:] + 282
    26 AddressBookUI 0x012e7f09 -[ABMembersController abDataSource:selectedPerson:atIndexPath:withMemberCell:animate:] + 89
    27 AddressBookUI 0x01363754 -[ABMembersDataSource tableView:didSelectRowAtIndexPath:] + 214
    28 UIKit 0x00901794 -[UITableView
    selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
    29 UIKit 0x008f7d50 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
    30 Foundation 0x0060a7f6
    NSFireDelayedPerform + 441
    31 CoreFoundation 0x022bafe3 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 19
    32 CoreFoundation 0x022bc594 CFRunLoopDoTimer + 1220
    33 CoreFoundation 0x02218cc9
    CFRunLoopRun + 1817
    34 CoreFoundation 0x02218240 CFRunLoopRunSpecific + 208
    35 CoreFoundation 0x02218161 CFRunLoopRunInMode + 97
    36 GraphicsServices 0x040ab268 GSEventRunModal + 217
    37 GraphicsServices 0x040ab32d GSEventRun + 115
    38 UIKit 0x0089a42e UIApplicationMain + 1160
    39 KitchenSink 0x0000372c main + 362
    40 KitchenSink 0x00002551 start + 53
    2011-02-20 08:35:07.607 KitchenSink[37787:207] Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan -0.5]'
    Call stack at first throw: ( 0 CoreFoundation 0x022d9be9 exceptionPreprocess + 185
    1 libobjc.A.dylib 0x0242e5c2 objc_exception_throw + 47
    2 CoreFoundation 0x02292628 +[NSException raise:format:arguments:] + 136
    3 CoreFoundation 0x0229259a +[NSException raise:format:] + 58
    4 QuartzCore 0x0190c96a ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 177
    5 QuartzCore 0x0190c8b5 -[CALayer setPosition:] + 42
    6 QuartzCore 0x0190c7cc -[CALayer setFrame:] + 763
    7 UIKit 0x008c1307 -[UIView(Geometry) setFrame:] + 255
    8 UIKit 0x009aca68 -[UILabel setFrame:] + 262
    9 AddressBookUI 0x0134615d -[ABPersonTableViewDataSource reloadNoValueLabelAnimated:] + 645
    10 AddressBookUI 0x0133e0a6 -[ABPersonTableViewDataSource reloadDataIncludingHeaderView:invalidatePropertyData:] + 318
    11 AddressBookUI 0x0133df62 -[ABPersonTableViewDataSource reloadDataIncludingHeaderView:] + 50
    12 AddressBookUI 0x0132878d -[ABPersonViewControllerHelper prepareViewWithDisplayedProperties:person:allowActions:] + 1195
    13 AddressBookUI 0x01322cee -[ABPersonViewControllerHelper loadViewWithDisplayedProperties:person:allowDeletion:allowActions:] + 68
    14 AddressBookUI 0x01319f1a -[ABPersonViewController loadView] + 144
    15 UIKit 0x009395e3 -[UIViewController view] + 56
    16 UIKit 0x00937a57 -[UIViewController contentScrollView] + 42
    17 UIKit 0x00948201 -[UINavigationController
    computeAndApplyScrollContentInsetDeltaForViewController:] + 48
    18 UIKit 0x00946831 -[UINavigationController layoutViewController:] + 43
    19 UIKit 0x00947b4c -[UINavigationController
    startTransition:fromViewController:toViewController:] + 524
    20 UIKit 0x00942606 -[UINavigationController startDeferredTransitionIfNeeded] + 266
    21 UIKit 0x0094983e -[UINavigationController pushViewController:transition:forceImmediate:] + 932
    22 UIKit 0x009424a0 -[UINavigationController pushViewController:animated:] + 62
    23 AddressBookUI 0x01312f79 -[ABPeoplePickerNavigationController pushViewController:animated:] + 162
    24 AddressBookUI 0x01314828 -[ABPeoplePickerNavigationController showCardForPerson:withMemberCell:animate:forceDisableEditing:personViewController:] + 1338
    25 AddressBookUI 0x01316d1d -[ABMembersViewController showCardForPerson:withMemberCell:animate:] + 282
    26 AddressBookUI 0x012e7f09 -[ABMembersController abDataSource:selectedPerson:atIndexPath:withMemberCell:animate:] + 89
    27 AddressBookUI 0x01363754 -[ABMembersDataSource tableView:didSelectRowAtIndexPath:] + 214
    28 UIKit 0x00901794 -[UITableView
    selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
    29 UIKit 0x008f7d50 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
    30 Foundation 0x0060a7f6
    NSFireDelayedPerform + 441
    31 CoreFoundation 0x022bafe3 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 19
    32 CoreFoundation 0x022bc594 CFRunLoopDoTimer + 1220
    33 CoreFoundation 0x02218cc9
    CFRunLoopRun + 1817
    34 CoreFoundation 0x02218240 CFRunLoopRunSpecific + 208
    35 CoreFoundation 0x02218161 CFRunLoopRunInMode + 97
    36 GraphicsServices 0x040ab268 GSEventRunModal + 217
    37 GraphicsServices 0x040ab32d GSEventRun + 115
    38 UIKit 0x0089a42e UIApplicationMain + 1160
    39 KitchenSink 0x0000372c main + 362
    40 KitchenSink 0x00002551 start + 53
    ) terminate called after throwing an instance of 'NSException'
    [INFO] Application has exited from Simulator

  8. tom quas 2011-04-15

    I guess that means that in addition to emails, phone number handling is broken, too.

  9. Stephen Tramer 2011-04-15

    This issue has actually been repeatedly reported with contacts at this point, meaning that it is in the queue to be fixed, but this additional information will be extremely helpful.

  10. tom quas 2011-04-15

    Ok, I got a crash log from a phone with approx. 1.800 contacts, synced frequently against an Exchange server. It seems to always crash in Thread 0 but Thread 9 has the relevant information in this case.

  11. tom quas 2011-04-15

    now, can we make this a tbs-1.6.1 issue, please? ;) seriously, my app depends on this stuff heavily. thx.

  12. tom quas 2011-04-15

    Stephen, from all projects I know, be it community or enterprise, a crash has never been considered 'low priority.' Can you give an ETA?

  13. Alan Leard 2011-04-15

    This user is also experiencing a crash when pulling contact information: http://developer.appcelerator.com/helpdesk/view/76124">http://developer.appcelerator.com/helpdesk/view/76124

  14. johnvpataki 2011-04-15

    I updated HD issue 76124 with more details about my scenario where contacts on the device crash when touching the 'address' property.

  15. Stephen Tramer 2011-04-15

    Duplicate of #2317.

  16. Lee Morris 2017-03-03

    Closing issue due to time passed and irrelevance of the ticket.

JSON Source