Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12326

Crash on Android: CommonDataKinds.*.LABEL

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      The ContactAccessorSdk5 is missing the "LABEL" CommonDataKinds column definition for multple Cursors, causing the "search" function to crash.

      is
      if (isRequired("emails", populate)) {
                  columnsToFetch.add(CommonDataKinds.Email._ID);
                  columnsToFetch.add(CommonDataKinds.Email.DATA);
                  columnsToFetch.add(CommonDataKinds.Email.TYPE);
              }
      
      should be
      if (isRequired("emails", populate)) {
                  columnsToFetch.add(CommonDataKinds.Email._ID);
                  columnsToFetch.add(CommonDataKinds.Email.DATA);
                  columnsToFetch.add(CommonDataKinds.Email.TYPE);
                  columnsToFetch.add(CommonDataKinds.Email.LABEL);
              }
      

      missing columns are:

      • CommonDataKinds.Phone.LABEL
      • CommonDataKinds.Email.LABEL
      • CommonDataKinds.StructuredPostal.LABEL
      • CommonDataKinds.Organization.LABEL
      • CommonDataKinds.Website.LABEL

      01-06 13:43:03.871 7333 7527 E AndroidRuntime: java.lang.IllegalStateException: Couldn't read row 174, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at android.database.CursorWindow.nativeGetString(Native Method)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at android.database.CursorWindow.getString(CursorWindow.java:451)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at android.database.CursorWrapper.getString(CursorWrapper.java:137)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at org.apache.cordova.contacts.ContactAccessorSdk5.emailQuery(ContactAccessorSdk5.java:900)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at org.apache.cordova.contacts.ContactAccessorSdk5.populateContactArray(ContactAccessorSdk5.java:428)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at org.apache.cordova.contacts.ContactAccessorSdk5.search(ContactAccessorSdk5.java:287)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at org.apache.cordova.contacts.ContactManager$3.run(ContactManager.java:209)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
      01-06 13:43:03.871 7333 7527 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            Nuts Andreas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment