Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20279

Android: Ti.Contacts.getAllPeople() crashes with overflow on Android < 6


    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 5.1.1
    • Fix Version/s: Release 6.0.0, Release 5.4.0
    • Component/s: Android
    • Labels:
    • Environment:

      SDK 5.1.1.GA
      Works in 5.1.2.GA and 5.2.0.GA

    • Story Points:
    • Sprint:
      2016 Sprint 15 SDK


      I am getting the “[ERROR] dalvikvm: JNI ERROR (app bug): local reference table overflow (max=512)” issue when simply calling Ti.Contacts.getAllPeople(). Literally, that ONE line of code is causing the error.

      • I have 2900 contacts (and I know plenty of people with more), so I am not an abnormal use case.
      • I know it is this one line because I have removed any other code around it (after the permissions of course), and the call works on Android 6.0+, but does not work on versions prior to Android 6.0.
      • It works perfectly fine when I run it against an emulator with 0 contacts, or even 5 contacts. I suspect that it is not releasing the memory when it iterates over the contacts that it is retrieving.

      The environments that I tested this on were:
      1. Multiple Android emulators, but they all follow the same specs (besides the screen size) as the attached image shows
      2. On a Galaxy S4 running Android 4.4.2

      Here is a snippet of the code:

      // Get permission to access the user's contacts
      var contactsAuthorizationValue = Ti.Contacts.getContactsAuthorization();
      if (contactsAuthorizationValue === Ti.Contacts.AUTHORIZATION_AUTHORIZED) {
      var rawContacts = Ti.Contacts.getAllPeople(); // This is where the crash occurs
      // Do more things down here


          Issue Links



              • Assignee:
                msamah Ashraf Abu (Inactive)
                Yrkh8trnoy Kiley Williams
              • Watchers:
                0 Start watching this issue


                • Created:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    Sync status:
                    Last received:
                    Last sent:

                    Git Integration