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

Contacts plugin causes app crash

    XMLWordPrintableJSON

    Details

      Description

      On Samsung phone app crashes instantly with a stack trace:

      java.lang.NumberFormatException
      java.lang.Integer.invalidInt(Integer.java:138)
      java.lang.Integer.parseInt(Integer.java:358)
      java.lang.Integer.parseInt(Integer.java:334)
      org.apache.cordova.contacts.ContactAccessorSdk5.imQuery(ContactAccessorSdk5.java:907)
      org.apache.cordova.contacts.ContactAccessorSdk5.populateContactArray(ContactAccessorSdk5.java:435)
      org.apache.cordova.contacts.ContactAccessorSdk5.search(ContactAccessorSdk5.java:282)
      org.apache.cordova.contacts.ContactManager$3.run(ContactManager.java:209)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      java.lang.Thread.run(Thread.java:818)
      

      JS code to retrieve contacts, on Sony phone the same code works properly:

      if(navigator.contacts) {
      	var options = new ContactFindOptions();
      	options.multiple = true;
      	options.hasPhoneNumber = true;
      	navigator.contacts.find([navigator.contacts.fieldType.phoneNumbers], contacts => {
      		this.phoneContacts = contacts;
      		d.resolve(contacts);
      	}, e => d.reject(e), options);
      }
      
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              petr.odut@gmail.com Petr Odut
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: